小编Rat*_*thy的帖子

Github Pages网站未检测到index.html

我创建了一个github页面存储库.出于某种原因,当我提供 https:// [用户名] .github.io /时,它不起作用.但是当我给https:// [用户名] .github.io/index.html时,它是有效的.为什么它没有检测index.html.

html github github-pages

50
推荐指数
8
解决办法
1万
查看次数

尝试在Constructor值上执行haskell模式匹配

我有一个函数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)

这与我的问题类似.

haskell pattern-matching

1
推荐指数
1
解决办法
125
查看次数

标签 统计

github ×1

github-pages ×1

haskell ×1

html ×1

pattern-matching ×1