package base

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Hash_set.PolySource

A hash set that uses polymorphic comparison

Sourcetype nonrec 'a t = 'a t
include Sexplib0.Sexpable.S1 with type 'a t := 'a t
Sourceval t_of_sexp : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t
Sourceval sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.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
Sourcetype 'a elt = 'a
Sourceval of_list : ('a, 'a elt list -> 'a t) create_options_without_first_class_module
include Accessors with type 'a t := 'a t with type 'a elt := 'a elt
include Container.Generic with type ('a, _) t := 'a t with type 'a elt := 'a elt
Sourceval length : _ t -> int
Sourceval is_empty : _ t -> bool
Sourceval iter : 'a t -> f:('a elt -> unit) -> unit
Sourceval fold : 'a t -> init:'acc -> f:('acc -> 'a elt -> 'acc) -> 'acc
Sourceval fold_result : 'a t -> init:'acc -> f:('acc -> 'a elt -> ('acc, 'e) Result.t) -> ('acc, 'e) Result.t
Sourceval fold_until : 'a t -> init:'acc -> f:('acc -> 'a elt -> ('acc, 'final) Container.Continue_or_stop.t) -> finish:('acc -> 'final) -> 'final
Sourceval exists : 'a t -> f:('a elt -> bool) -> bool
Sourceval for_all : 'a t -> f:('a elt -> bool) -> bool
Sourceval count : 'a t -> f:('a elt -> bool) -> int
Sourceval sum : (module Container.Summable with type t = 'sum) -> 'a t -> f:('a elt -> 'sum) -> 'sum
Sourceval find : 'a t -> f:('a elt -> bool) -> 'a elt option
Sourceval find_map : 'a t -> f:('a elt -> 'b option) -> 'b option
Sourceval to_list : 'a t -> 'a elt list
Sourceval to_array : 'a t -> 'a elt array
Sourceval min_elt : 'a t -> compare:('a elt -> 'a elt -> int) -> 'a elt option
Sourceval max_elt : 'a t -> compare:('a elt -> 'a elt -> int) -> 'a elt option
Sourceval mem : 'a t -> 'a -> bool

override Container.Generic.mem

Sourceval copy : 'a t -> 'a t

preserves the equality function

Sourceval add : 'a t -> 'a -> unit
Sourceval strict_add : 'a t -> 'a -> unit Or_error.t

strict_add t x returns Ok () if the x was not in t, or an Error if it was.

Sourceval strict_add_exn : 'a t -> 'a -> unit
Sourceval remove : 'a t -> 'a -> unit
Sourceval strict_remove : 'a t -> 'a -> unit Or_error.t

strict_remove t x returns Ok () if the x was in t, or an Error if it was not.

Sourceval strict_remove_exn : 'a t -> 'a -> unit
Sourceval clear : 'a t -> unit
Sourceval equal : 'a t -> 'a t -> bool
Sourceval filter : 'a t -> f:('a -> bool) -> 'a t
Sourceval filter_inplace : 'a t -> f:('a -> bool) -> unit
Sourceval inter : 'key t -> 'key t -> 'key t

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.

Sourceval union : 'a t -> 'a t -> 'a t
Sourceval diff : 'a t -> 'a t -> 'a t
Sourceval of_hashtbl_keys : ('a, _) Hashtbl.t -> 'a t
Sourceval to_hashtbl : 'key t -> f:('key -> 'data) -> ('key, 'data) Hashtbl.t
OCaml

Innovation. Community. Security.