Haskell' - class aliases

Tom Schrijvers Tom.Schrijvers at cs.kuleuven.be
Fri May 2 09:37:50 EDT 2008


>> class alias Foo a => Foo a = Bar a where ...
>
> Has a defined (if not very useful) meaning with class aliases, but is
> really odd if you consider 'Foo a' a "superclass". So, I think the
> following terminology should be used:
>
>   Context of --+
>   alias        |     The alias -+    +--- The expansion of the alias
>                |                |    |
>                v                v    v
>> class alias (S1 a .. Sn a) => A a = (C1 a ... Cn a) where
>>      fd1 = ....
>>      ....
>>      fdn = ....
>            ^
>            +----  The defaults of the alias

Should all of the arguments of the Ci be the same type variable `a' as in 
the alias A a or can they be other types as well, like e.g. C1 [a] or C2 
Int?

Tom

--
Tom Schrijvers

Department of Computer Science
K.U. Leuven
Celestijnenlaan 200A
B-3001 Heverlee
Belgium

tel: +32 16 327544
e-mail: tom.schrijvers at cs.kuleuven.be
url: http://www.cs.kuleuven.be/~toms/


More information about the Haskell-prime mailing list