我创建了一个github页面存储库.出于某种原因,当我提供 https:// [用户名] .github.io /时,它不起作用.但是当我给https:// [用户名] .github.io/index.html时,它是有效的.为什么它没有检测index.html.
我有一个函数getImage,它接受DynamicImage类型的输入并将其更改为图像.功能如下
getImage (ImageY8 image) = image
getImage (ImageY16 image) = image
Run Code Online (Sandbox Code Playgroud)
以上定义来自Codec.Picture模块.但它给了我一个错误:
Couldn't match type ‘GHC.Word.Word16’ with ‘GHC.Word.Word8’
Expected type: Image Pixel8
Actual type: Image Pixel16
In the expression: image
In an equation for ‘getImage’: getImage (ImageY16 image) = image
Failed, modules loaded: none.
Run Code Online (Sandbox Code Playgroud)
为什么这不起作用,因为我可以执行以下操作:
data Shape = Circle Float | Rectangle Float Float
area (Circle r) = 3.14 * r * r
area (Rectangle a b) = a * b
Run Code Online (Sandbox Code Playgroud)
这与我的问题类似.