move Set_ext to just Set

This commit is contained in:
Rhiannon Morris 2020-12-06 10:15:56 +01:00
parent 812fa7498c
commit 9326f47ba2
6 changed files with 18 additions and 14 deletions

View File

@ -1,4 +1,4 @@
module IntSet = Set_ext.Make(Int)
module IntSet = Set.Make(Int)
let read_ints =
Bracket.infile_lines ~line:int_of_string ~of_seq:IntSet.of_seq

View File

@ -17,7 +17,7 @@ let%test_module _ = (module struct
end)
module StrSet = Set_ext.Make(String)
module StrSet = Set.Make(String)
let optional_fields = StrSet.singleton "cid"

View File

@ -1,4 +1,4 @@
module CharSet = Set_ext.Make(Char)
module CharSet = Set.Make(Char)
let to_set str = String.to_seq str |> CharSet.of_seq

View File

@ -1,10 +1,12 @@
module type OrderedType = Stdlib.Set.OrderedType
module type S = sig
include Set.S
include Stdlib.Set.S
val exists_opt: (elt -> 'a option) -> t -> 'a option
end
module Make(Elt: Set.OrderedType) = struct
include Set.Make(Elt)
module Make(Elt: OrderedType) = struct
include Stdlib.Set.Make(Elt)
let exists_opt (type a) (f: elt -> a option) set =
let exception Found of a in

10
set.mli Normal file
View File

@ -0,0 +1,10 @@
module type OrderedType = Stdlib.Set.OrderedType
module type S = sig
include Stdlib.Set.S
val exists_opt: (elt -> 'a option) -> t -> 'a option
end
module Make(Elt: OrderedType): S
with type elt = Elt.t
and type t = Stdlib.Set.Make(Elt).t

View File

@ -1,8 +0,0 @@
module type S = sig
include Set.S
val exists_opt: (elt -> 'a option) -> t -> 'a option
end
module Make(Elt: Set.OrderedType): S
with type elt = Elt.t
and type t = Set.Make(Elt).t