We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
> foldl (\a as -> [a] ++ as) [] [1,2,3] <repl>:1:17: Occurs error [a]
The text was updated successfully, but these errors were encountered:
ghci says that it can not construct infinite type here
Sorry, something went wrong.
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:
foldl (\a as -> [a] ++ as)
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
b ~ [b]
Ok, but it's better write it out in this way.
It's issue for better report of error of this type
No branches or pull requests
The text was updated successfully, but these errors were encountered: