Malformed class assertion with GHCi's output (a -> a ~ T a)

Sean Leather leather at cs.uu.nl
Tue Sep 15 07:50:45 EDT 2009


I queried (:t) the type of something in GHCi, and it told me the value
should have the constraint (a -> a ~ T a) among others. When I tried to use
this in code, I got a "malformed class assertion." So, I put parentheses
around the function type, ((a -> a) ~ T a), and everybody is happy again. Is
there something off about the precedence of (~) vs. (->)? Should GHCi print
the parentheses?

I'm using GHC 6.10.1, so this might already be fixed.

Regards,
Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20090915/684357e3/attachment.html


More information about the Glasgow-haskell-users mailing list