package soteria

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

Module Var.Hashset

type elt = t
type t
val with_capacity : int -> t

Create a new empty set with the given initial capacity.

val singleton : elt -> t

Create a set containing a single element.

val add : t -> elt -> unit

Add an element to the set.

val add_check : t -> elt -> bool

add_check set x adds x to set and returns true if it was not already present, and false otherwise.

val add_iter : t -> elt Iter.t -> unit

Add elements from an iterator to the set.

val mem : t -> elt -> bool

Test whether an element is a member of the set.

val remove : t -> elt -> unit

Remove an element from the set.

val iter : (elt -> unit) -> t -> unit

Iterate over all elements in the set.

val to_seq : t -> elt Soteria_std.Seq.t

Return a sequence of all elements in the set.

val of_seq : elt Soteria_std.Seq.t -> t

Create a set from a sequence of elements.

val of_iter : elt Iter.t -> t

Create a set from an iterator of elements.

val cardinal : t -> int

Return the number of elements in the set.

val copy : t -> t

Return a copy of the set.

val subseteq : t -> t -> bool

Test whether the first set is a subset of the second set.

val equal : t -> t -> bool

Test whether two sets are equal.

val pp : Format.formatter -> t -> unit

Pretty-printer for the set.