小编aaa*_*aaa的帖子

为什么不这个类型检查呢?

compress xs@(_:_:_) = (ifte <$> ((==) <$> head <*> head.tail) <$> ((compress.).(:) <$> head <*> tail.tail) <*> ((:) <$> head <*> compress.tail) ) xs

导致类型错误,但我不明白为什么.它应该相当于

compress xs@(_:_:_) = (ifte (((==) <$> head <*> head.tail) xs) (((compress.).(:) <$> head <*> tail.tail) xs) (((:) <$> head <*> compress.tail) xs))

,没有.

注意:ifte = (\ x y z -> if x then y else z),<$><*>Control.Applicative.

编辑:错误是:

Couldn't match expected type `[a]' with actual type `[a] …
Run Code Online (Sandbox Code Playgroud)

debugging haskell types typechecking pointfree

0
推荐指数
2
解决办法
202
查看次数

标签 统计

debugging ×1

haskell ×1

pointfree ×1

typechecking ×1

types ×1