Closed hamnox closed 7 years ago
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
The parseHash
function has this type:
parseHash : Parser (a -> a) a -> Location -> Maybe a
The s
function has this type:
s : String -> Parser a a
So s "" : Parser a a
and when it is given to parseHash
it needs to be unified with Parser (a -> a) a
. That leads to an infinite type if a -> a
must be the same as a
. So this error seems to be describing the problem exactly.
With 0.18, you can see the compiler fail on certain infinite types. This is fixed with the dev version of the compiler, so it'll be fixed in the next release. I believe that is the root issue here.
Mac OS X El capitan (10.11.6), elm v0.18.0, url-parser v2.0.1
Self-referential type error when parsing (s "")
This bug originally surfaced as the compiler mysteriously stalling as soon as I added a test for an empty hash. Repl gave me a more useful error.
From previous issues like #21 , it looks like the proper way to accomplish what I wanted is with 'top'. The fact that this bug was silent, though, worries me.