Type classes in GADTs

C Rodrigues red5_2 at hotmail.com
Thu Oct 30 11:09:51 EDT 2008

Thanks for the explanation.  I see how this wouldn't behave nicely with automatic class constraint inference.  I didn't test the example on any other GHC versions.

I will probably end up passing in the Eq dictionary from outside like Daniil suggested.  I would prefer to do the following, but GHC doesn't accept the type signature.

evidenceOfEq :: CAOp a -> (Eq a => b) -> b

Neither does it accept data EqConstraint a b = EqConstraint (Eq a => b).  Foiled again.
Want to read Hotmail messages in Outlook? The Wordsmiths show you how.

More information about the Glasgow-haskell-users mailing list