Commits

camlspotter committed 7dc3617

xset

  • Participants
  • Parent commits 8c9bcf0

Comments (0)

Files changed (3)

   include Xsys
 end
 
-module Set = struct
-  module type S = Set.S
-  module Make( Ord: Set.OrderedType) = struct
-    module M = Set.Make(Ord)
-    include M
-    include Xset.Extend(M)
-  end
-end
+module Set = Xset
 open Set
 
-module Extend(Set : S) = struct
-  open Set
+module type S = sig
+  include S
+  val of_list : elt list -> t
+  val (+) : t -> t -> t (** union *)
+  val (-) : t -> t -> t (** diff *)
+  val one : elt -> t (** singleton *)
+  val unions : t list -> t
+  val to_list : t -> elt list (** elements *)
+end
+
+module Make(O : OrderedType) = struct
+  include Make(O)
 
   let of_list = 
     let rec of_list st = function

File lib/xset.mli

-module Extend(Set : Set.S) : sig
-  val of_list : Set.elt list -> Set.t
-  val (+) : Set.t -> Set.t -> Set.t (** union *)
-  val (-) : Set.t -> Set.t -> Set.t (** diff *)
-  val one : Set.elt -> Set.t (** singleton *)
-  val unions : Set.t list -> Set.t
-  val to_list : Set.t -> Set.elt list (** elements *)
+module type S = sig
+  include Set.S
+  val of_list : elt list -> t
+  val (+) : t -> t -> t (** union *)
+  val (-) : t -> t -> t (** diff *)
+  val one : elt -> t (** singleton *)
+  val unions : t list -> t
+  val to_list : t -> elt list (** elements *)
 end
+
+module Make(O : Set.OrderedType) : S 
+  with type elt = O.t