Module Hash_set.Poly
A hash set that uses polymorphic comparison
type nonrec 'a t= 'a t
include Base.Sexpable.S1 with type 'a t := 'a t
val t_of_sexp : (Base.Sexp.t -> 'a) -> Base.Sexp.t -> 'a tval sexp_of_t : ('a -> Base.Sexp.t) -> 'a t -> Base.Sexp.t
include Creators_generic with type 'a t := 'a t with type 'a elt = 'a with type ('key, 'z) create_options := ('key, 'z) create_options_without_first_class_module
val create : ('a, unit -> 'a t) create_optionsval of_list : ('a, 'a elt list -> 'a t) create_options
include Accessors with type 'a t := 'a t with type 'a elt := 'a elt
include Base.Container.Generic
val length : _ t -> intval is_empty : _ t -> boolval iter : 'a t -> f:('a elt -> unit) -> unitval fold : 'a t -> init:'accum -> f:('accum -> 'a elt -> 'accum) -> 'accumval fold_result : 'a t -> init:'accum -> f:('accum -> 'a elt -> ('accum, 'e) Base.Result.t) -> ('accum, 'e) Base.Result.tval fold_until : 'a t -> init:'accum -> f:('accum -> 'a elt -> ('accum, 'final) Base__.Container_intf.Continue_or_stop.t) -> finish:('accum -> 'final) -> 'finalval exists : 'a t -> f:('a elt -> bool) -> boolval for_all : 'a t -> f:('a elt -> bool) -> boolval count : 'a t -> f:('a elt -> bool) -> intval sum : (module Base__.Container_intf.Summable with type t = 'sum) -> 'a t -> f:('a elt -> 'sum) -> 'sumval find : 'a t -> f:('a elt -> bool) -> 'a elt optionval find_map : 'a t -> f:('a elt -> 'b option) -> 'b optionval to_list : 'a t -> 'a elt listval to_array : 'a t -> 'a elt arrayval min_elt : 'a t -> compare:('a elt -> 'a elt -> int) -> 'a elt optionval max_elt : 'a t -> compare:('a elt -> 'a elt -> int) -> 'a elt option
val mem : 'a t -> 'a -> booloverride
Container.Generic.mem
val add : 'a t -> 'a -> unitval strict_add : 'a t -> 'a -> unit Base.Or_error.tstrict_add t xreturnsOk ()if thexwas not int, or anErrorif it was.
val strict_add_exn : 'a t -> 'a -> unitval remove : 'a t -> 'a -> unitval strict_remove : 'a t -> 'a -> unit Base.Or_error.tstrict_remove t xreturnsOk ()if thexwas int, or anErrorif it was not.
val strict_remove_exn : 'a t -> 'a -> unitval clear : 'a t -> unitval equal : 'a t -> 'a t -> boolval filter : 'a t -> f:('a -> bool) -> 'a tval filter_inplace : 'a t -> f:('a -> bool) -> unitval inter : 'key t -> 'key t -> 'key tinter t1 t2computes the set intersection oft1andt2. Runs in O(min(length t1, length t2)). Behavior is undefined ift1andt2don't have the same equality function.
val diff : 'a t -> 'a t -> 'a tval of_hashtbl_keys : ('a, _) Base.Hashtbl.t -> 'a tval to_hashtbl : 'key t -> f:('key -> 'data) -> ('key, 'data) Base.Hashtbl.t