English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] User-defined equality on types?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-04-24 (08:33)
From: Andreas Rossberg <rossberg@p...>
Subject: Re: [Caml-list] User-defined equality on types?
Brian Rogoff wrote:
> On Mon, 23 Apr 2001, Xavier Leroy wrote:
> > > I'd like to suggest allowing the user to define a chosen interpretation
> > > of the equality symbol, and perhaps the polymorphic orderings too, on
> > > each new (maybe just abstract) data type. This seems natural in the
> > > context of abstract data types with non-canonical representation, giving
> > > a kind of quotient type. Has this ever been considered?
> >
> > Yes.  This was one of the first motivations for Haskell type classes,
> > I believe.
> Would the proposed generic polymorphism extension solve this problem?

Probably not, because unlike type classes generic functions are closed
and do not allow adding cases for new types later on.

Andreas Rossberg, rossberg@ps.uni-sb.de

"Computer games don't affect kids.
 If Pac Man affected us as kids, we would all be running around in
 darkened rooms, munching pills, and listening to repetitive music."
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr