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

Simon Peyton-Jones simonpj at
Fri Oct 2 07:16:50 EDT 2009

Thanks.   I've fixed this.

Ian: pls merge if time.


Fri Oct  2 12:15:49 BST 2009  simonpj at
  * Fix pretty-printing precedence for equality constraints

    M ./compiler/types/TypeRep.lhs -1 +7

From: glasgow-haskell-users-bounces at [mailto:glasgow-haskell-users-bounces at] On Behalf Of Sean Leather
Sent: 15 September 2009 12:51
To: GHC Users List
Subject: Malformed class assertion with GHCi's output (a -> a ~ T a)

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.

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Glasgow-haskell-users mailing list