We use [@@deriving sexp_of] but not [@@deriving sexp] because we want people to be explicit about the hash and comparison functions used when creating hashtables. One can use Hash_set.Poly.t, which does have [@@deriving sexp], to use polymorphic comparison and hashing.
type nonrec ('key, 'z) create_options = ?growth_allowed:bool -> ?size:int -> (module Base__Hashtbl_intf.Key.S with type t = 'key) -> 'zinclude Creators with type 'a t := 'a t
val create : ?growth_allowed:bool -> ?size:int -> (module Base__Hashtbl_intf.Key.S with type t = 'a) -> 'a tval of_list : ?growth_allowed:bool -> ?size:int ->
(module Base__Hashtbl_intf.Key.S with type t = 'a) -> 'a list -> 'a tinclude Accessors with type 'a t := 'a t with type 'a elt = 'a
include Container.Generic with type 'a t := 'a t with type 'a elt = 'a
val 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) Result.t) ->
('accum, 'e) Result.tval fold_until : 'a t -> init:'accum -> f:('accum -> 'a elt -> ('accum, 'final) Base__Container_intf.Export.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 optionval mem : 'a t -> 'a -> booloverride Container.Generic.mem
preserves the equality function
val add : 'a t -> 'a -> unitstrict_add t x returns Ok () if the x was not in t, or an Error if it was.
val strict_add_exn : 'a t -> 'a -> unitval remove : 'a t -> 'a -> unitstrict_remove t x returns Ok () if the x was in t, or an Error if it was not.
val strict_remove_exn : 'a t -> 'a -> 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 t2 computes the set intersection of t1 and t2. Runs in O(min(length t1, length t2)). Behavior is undefined if t1 and t2 don't have the same equality function.
val union : 'a t -> 'a t -> 'a tval diff : 'a t -> 'a t -> 'a tval to_hashtbl : 'key t -> f:('key -> 'data) -> ('key, 'data) Hashtbl.tval hashable_s : 'key t -> 'key Key.ttype nonrec ('key, 'z) create_options_without_first_class_module = ?growth_allowed:bool -> ?size:int -> 'zmodule Poly : sig ... endA hash set that uses polymorphic comparison
M is meant to be used in combination with OCaml applicative functor types: