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
'a Set?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-01-26 (15:35)
From: Frédéric_Gava <frederic.gava@w...>
Subject: Re: [Caml-list] 'a Set?
Hi,

> Compared to a flat set of functions, the functor approach has the
advantage of
> enforcing a consistently used compare function.
Ok, I am agree.  It is just a remark about coherence of names of functions
and
interfaces of the modules in the stdlib. There is many ModuleName.S
interfaces. Have the same names for functions that have the same semantics
seems (to me) a good things. (for example, have a function cardinal  in the
module Map, even if we could implemented this with a fold; the cardinal
function of the Sets are could also be implemented with a fold)

>The same effect can be
> achieved with "elt = 'a" by writing a higher-order function which returns
a
> record containing the Set.* functions using the given function argument as
> the compare function. Something equivalent to this:
>
>   type 'a t = 'a list
>....
> Cheers,
> Jon.
Ok. I am also agree. But the complexity is the problem of this data
structure ;-)

Cheers,
Frédéric Gava