Dear camelers, I thought that two applications of Set.Make to the same module would result in two distinct modules with two distinct types 't'. This is not the case, and I am no sure it is a good choice as it allows to write the following, where you can break the invariant of a functor: ------------------------------------------------------------------------- let is_prime n = let rec fn d = if d * d > n then true else if n mod d = 0 then false else fn (d+1) in fn 2 let rec random_prime n = let p = 2 + Random.int (n-2) in if is_prime p then p else random_prime n module type S = sig type elt type t val create : elt list -> t end module F(O:Set.OrderedType) : S with type elt = O.t = struct type elt = O.t type t = O.t list let salt = random_prime 1_000_000 let _ = Printf.printf "salf: %d\n%!" salt let f x = Hashtbl.hash (Hashtbl.hash x * salt) let cmp x y = match compare (f x) (f y) with | 0 -> compare x y | c -> c let create l = List.sort cmp l end module Int = struct type t = int let compare = compare end module M1 = F(Int) module M2 = F(Int) let _ = Printf.printf "test: %b\n%!" (M1.create [1;2;3;4;5] = M2.create [1;2;3;4;5]) ---------------------------------------------------------------------------- OK, I know how to rewrite this functor so that M1.t and M2.t are distinct. But still the above code should be rejected, shouldn't it ? Cheers, Christophe