Haskell不明确的变量?

时间:2017-01-23 20:04:02

标签: haskell fold

如果我尝试运行这个msall小代码:

module Problem14 where 

duplicate = foldl (\acc x -> acc ++ [x,x]) []

我收到GHCi的以下错误消息:

*Ambiguous type variable `t0' arising from a use of `foldl'
prevents the constraint `(Foldable t0)' from being solved.
Relevant bindings include*

为什么GHCi会给我这个消息?

0 个答案:

没有答案
相关问题