Open anton-k opened 3 years ago
ghci says that it can not construct infinite type here
Nothing cryptic. Occurs check prevents construction of inifinite types
foldl :: (b -> a -> b) -> b -> [a] -> b
(\a as -> [a] ++ as) :: c -> [c] -> [c]
thus unification foldl (\a as -> [a] ++ as)
produces set of equations:
c ~ b
a ~ [c]
b ~ [c]
From what we generate equation b ~ [b]
which means b is infinite type. Occurs check prevents construction of such types
Ok, but it's better write it out in this way.
It's issue for better report of error of this type