new function Extset.print

parent 4ead4697
...@@ -165,8 +165,8 @@ LIBGENERATED = src/util/config.ml \ ...@@ -165,8 +165,8 @@ LIBGENERATED = src/util/config.ml \
lib/ocaml/why3__BigInt_compat.ml lib/ocaml/why3__BigInt_compat.ml
LIB_UTIL = config bigInt util opt lists strings \ LIB_UTIL = config bigInt util opt lists strings \
extmap extset exthtbl weakhtbl \ pp extmap extset exthtbl weakhtbl \
hashcons stdlib exn_printer pp json debug loc lexlib print_tree \ hashcons stdlib exn_printer json debug loc lexlib print_tree \
cmdline warning sysutil rc plugin bigInt number pqueue cmdline warning sysutil rc plugin bigInt number pqueue
LIB_CORE = ident ty term pattern decl coercion theory \ LIB_CORE = ident ty term pattern decl coercion theory \
......
...@@ -50,6 +50,7 @@ module type S = sig ...@@ -50,6 +50,7 @@ module type S = sig
val contains: t -> elt -> bool val contains: t -> elt -> bool
val add_left: t -> elt -> t val add_left: t -> elt -> t
val remove_left: t -> elt -> t val remove_left: t -> elt -> t
val print: (Format.formatter -> elt -> unit) -> Format.formatter -> t -> unit
end end
module MakeOfMap (M: Extmap.S) = struct module MakeOfMap (M: Extmap.S) = struct
...@@ -97,6 +98,12 @@ module MakeOfMap (M: Extmap.S) = struct ...@@ -97,6 +98,12 @@ module MakeOfMap (M: Extmap.S) = struct
let contains = M.contains let contains = M.contains
let add_left s e = M.add e () s let add_left s e = M.add e () s
let remove_left s e = M.remove e s let remove_left s e = M.remove e s
let print print_elt fmt s =
if is_empty s then Format.fprintf fmt "{}" else begin
Format.fprintf fmt "@[<hov 2>{ ";
Pp.print_iter1 iter Pp.comma print_elt fmt s;
Format.fprintf fmt "}@]"
end
end end
module type OrderedType = Set.OrderedType module type OrderedType = Set.OrderedType
......
...@@ -170,6 +170,9 @@ module type S = ...@@ -170,6 +170,9 @@ module type S =
val remove_left: t -> elt -> t val remove_left: t -> elt -> t
(** [remove_left s x] is the same as [remove x s]. *) (** [remove_left s x] is the same as [remove x s]. *)
val print: (Format.formatter -> elt -> unit) ->
Format.formatter -> t -> unit
end end
module MakeOfMap (M : Extmap.S) : S with module M = M module MakeOfMap (M : Extmap.S) : S with module M = M
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment