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-19 (19:57)
From: Alain Frisch <frisch@c...>
Subject: Re: [Caml-list] User-defined equality on types?
On Wed, 18 Apr 2001, John R Harrison 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. 
> Any opinions?

I support this suggestion. The standard equality/ordering/hashing
functions are often adequate for most of the data structures, and it would
be useful to use them and just place a hook on specific types to provide
specialized implementation. It could almost be done with
the "custom" block tag; the problem is that such blocks are not garbage
collected.  What about "custom Caml blocks" ?

  Alain Frisch

To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr