functional dependencies

Iavor S. Diatchki
Sun, 3 Feb 2002 11:52:37 -0800


there seems to be a difference between the way superclasses are handled in 
GHC and Hugs, and it would be nice if one of the choices was selected
(i am not sure what other implementations do).  here is what i mean:

class C a b | a -> b
class C a b => D a


class C a b | a -> b
class C a b => D a b

Hugs accepts both of those, while GHC insists on the second.  the first 
example is a little shorter and one might argue that if we know "a" we also 
know "b", because of the functional depency, so it is not really a parameter.
on the other hand, i would expect writing "b" in the type signatures of any 
of the methods to refer to the particular "b" determined by the "a", rather 
than it becomeing universally quantified, and perhaps this is more explicit 
in the second form.