
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. http://windowslive.com/connect/post/wedowindowslive.spaces.live.com-Blog-cns...

2008/10/30 C Rodrigues
evidenceOfEq :: CAOp a -> (Eq a => b) -> b
isn't that the same as: evidenceOfEq :: Eq a => CAOp a -> b -> b
Neither does it accept data EqConstraint a b = EqConstraint (Eq a => b). Foiled again.
same here: data Eq a => EqConstraint a b = EqConstraint b. although this must be a typo, since it doesn't make any sense to me.
participants (2)
-
C Rodrigues
-
Thomas Schilling