package core
Module Core.Hash_setSource
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.
include Base.Hash_set.Accessors
with type 'a t := 'a t
with type 'a elt := 'a Base.Hash_set.elt
include Base.Container.Generic
with type 'a t := 'a t
with type 'a elt := 'a Base.Hash_set.elt
Source
val fold_result :
'a t ->
init:'accum ->
f:('accum -> 'a Base.Hash_set.elt -> ('accum, 'e) Base.Result.t) ->
('accum, 'e) Base.Result.tSource
val fold_until :
'a t ->
init:'accum ->
f:
('accum ->
'a Base.Hash_set.elt ->
('accum, 'final) Base.Container.Continue_or_stop.t) ->
finish:('accum -> 'final) ->
'finalSource
val sum :
(module Base.Container.Summable with type t = 'sum) ->
'a t ->
f:('a Base.Hash_set.elt -> 'sum) ->
'sumSource
val min_elt :
'a t ->
compare:('a Base.Hash_set.elt -> 'a Base.Hash_set.elt -> int) ->
'a Base.Hash_set.elt optionSource
val max_elt :
'a t ->
compare:('a Base.Hash_set.elt -> 'a Base.Hash_set.elt -> int) ->
'a Base.Hash_set.elt optionstrict_add t x returns Ok () if the x was not in t, or an Error if it was.
strict_remove t x returns Ok () if the x was in t, or an Error if it was not.
inter 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.
include Base.Hash_set.For_deriving with type 'a t := 'a t
M is meant to be used in combination with OCaml applicative functor types:
Source
val m__t_sexp_grammar :
(module Base__.Hash_set_intf.M_sexp_grammar with type t = 'elt) ->
'elt t Sexplib0.Sexp_grammar.tSource
val quickcheck_generator_m__t :
(module M_quickcheck with type t = 'key) ->
'key t Base_quickcheck.Generator.tSource
val quickcheck_observer_m__t :
(module M_quickcheck with type t = 'key) ->
'key t Base_quickcheck.Observer.tSource
val quickcheck_shrinker_m__t :
(module M_quickcheck with type t = 'key) ->
'key t Base_quickcheck.Shrinker.t