Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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?

> 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
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
> 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 ;-)

Frédéric Gava