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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Judicael Courant <Judicael.Courant@e...>
Subject: Re: module Set


>> I would like to use this property  ; can't you  give us this property in
>> the module Set for the next release ?
>I'd rather not.  What you're looking for is not sets, but sets with
>some extra ordering properties.  Don't use the generic Set package, then.
>Use your own Ordered_set package.  (Feel free to cut and paste from
> to implement it, of course.)  Well-defined abstract interfaces
>are more important that code sharing, in my opinion.

Then, I think everybody would be happy with the following solution :

- Jean-Christophe implements an Ordered_set package (by cuting and
  pasting the current Set);

- You integrate it into the next release;

- By the way, you take advantage of this new Ordered_set module to
  replace the implementation of Set by mine (set.mli remains
  unchanged of course) :

(* *)
(* a very clever implementation of set.mli *)
(* generously put in the public domain by Judicael Courant *)

open Ordered_set

module type OrderedType= OrderedType
module type S = S

module Make = Make
(* That's all folks ! *)

Hence, you have very-well defined abstract interfaces together with
code sharing. Isn't that a very good solution ?


tel : (+33) 04 72 72 82 28
Beware of bugs in the above code; I have only proved it correct, not tried it.
                -- Donald Knuth