[Haskell-cafe] Re: Small displeasure with associated type synonyms

Tom Schrijvers Tom.Schrijvers at cs.kuleuven.be
Fri Mar 7 02:07:57 EST 2008

> Am I correct in thinking this would have worked if it were an
> associated type instead of an associated type synonym?
> ie,
> class C a where
>    data T a
>    val :: T a

Yes, you are. Associate data type constructors (as well as ordinary 
algebraic data constructors) are injective. So we have:

 	forall a b . T a = T b <=> a = b



Tom Schrijvers

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

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

More information about the Haskell-Cafe mailing list