[Haskell] Signature error because the order

Martijn van Steenbergen martijn at van.steenbergen.nl
Thu Jan 14 07:24:16 EST 2010


Hi Luis,

Luis Cabellos wrote:
> But if I change the order of *Show* and *Num* in the signature of 
> /prettyShow/ it works.
> 
> It's a GHC problem? it's normal than signature is order-dependent?

I think this is on purpose. The error specifically says that the 
contexts must be identical (rather than containing the same classes in 
arbitrary). I suspect this is how Haskell98 has specified it.

If you enable the RelaxedPolyRec language extension, this restriction no 
longer applies and your code compiles fine.

Hope this helps,

Martijn.



More information about the Haskell mailing list