module SetFuns (OT: Map.OrderedType) (SBLE: STRINGABLE with type t = OT.t) = struct module S = Set.Make(OT) let of_list l = List.fold_right S.add l S.empty (* map from Set to Set of the same type. currying heaven. *) let map f s = S.fold (fun x -> S.add (f x)) s S.empty let ppr ff s = Format.fprintf ff "@[{"; ppr_list_inners ( fun ff x -> Format.fprintf ff "%s" (SBLE.to_string x); ) ff (S.elements s); Format.fprintf ff "}@]" end