Haskell' - class aliases
simonpj at microsoft.com
Thu May 1 10:42:53 EDT 2008
| Yeah, I disagree here, mainly because I don't want to conflate
| superclasses with class aliases. I feel they have different uses, even
| though they can sometimes achieve the same thing.
Fair enough. But the strange syntax
class alias Num a = Eq a => (Additive a, Multiplicative a)
*does* seem so say that the (Eq a) behaves in a superclass way, and (Additive a, Multiplicative a) behave in a class-alias way, as it were. That seems inconsistent with the design goal you describe above.
Perhaps I can put it like this: if you want the "(Eq a) =>" part of the above decl, then you should also allow method definitions in the same decl.
Once this point settles down, would you like to refine your specification in the light of my misunderstandings? The more precise it is, the easier it is to implement.
Concerning Twan's idea, my brain is too small to accommodate the similarities and differences (today at any rate). But from an implementer's point of view, it'd be nice to have one proposal on the table rather than two competing ones....
More information about the Haskell-prime