In <http://www.dcs.gla.ac.uk/~simonpj/multi-param.html>,
Simon L Peyton Jones <[EMAIL PROTECTED]> wrote:

 |    5. In the signature of a class operation, every constraint must
 |       mention at least one type variable that is not a class type
 |       variable. Thus:
 ...
 |       > class C a where
 |       >    op :: Eq a => (a,b) -> (a,b)
 |
 |       is not OK because the constraint (Eq a) mentions on the class type
 |       variable a, and no others.

What's the rationale for this rule?

 |       (GHC 3.02 enforces a more restrictive rule, but that's definitely
 |       wrong.)
 |       A yet more relaxed rule would allow the context of a class-op
 |       signature to mention only class type variables. I don't like that
 |       from an implementation point of view;

Could you be more specific?  What's the implementation difficulty?

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]        |     -- the last words of T. S. Garp.


Reply via email to