I had defined an alias for the function execState
:
myCleverName = execState
GHC warned about a top-level binding with no annotated type signature, so I'd written:
myCleverName :: State s a => s -> s
Immediately obvious to most of you is that "fat arrow" =>
should have just been a regular skinny one ->
. But I only just noticed that today, yet both the module containing the alias and the code using the alias have been compiling fine for weeks, with not so much as a warning that I used the wrong syntax. Why is that?
Thanks!
GHC 7.6.3 had a bug that allowed things like this but it's fixed (or should be) in GHC 7.8. Internally, type class constraints are represented as implicit function arguments and I think that's why 7.6.3 was confused. They still are represented that way, but the sanity checking has been improved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With