Skip to content

Instantly share code, notes, and snippets.

@rrichardson
Created July 14, 2015 03:11
Show Gist options
  • Save rrichardson/733766d7656fd37f2a69 to your computer and use it in GitHub Desktop.
Save rrichardson/733766d7656fd37f2a69 to your computer and use it in GitHub Desktop.
## ERRORS in Chess/Util.elm ####################################################
-- INFINITE TYPE ------------------------------------------------ Chess/Util.elm
I am inferring weird self-referential type for `g`
30| let group1 = foldl (\x (g::gs) -> if (x == head g) then (x::g)::gs else [x]::g::gs)
^
The bit of the type that is self-referential looks like this:
a = Maybe a
The cause is often that the usage of `g` is flipped around.
Maybe you are inserting a data structure into an element? Maybe you are giving
a function to an argument? Either way, something is probably backwards!
Try breaking the code related to `g` into smaller pieces.
Give each piece a name and try to write down its type.
Detected errors in 1 module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment