Prelude.Hashset
Represents a set of values, with no duplicates
Represents a set of values, with no duplicates
Represents a set of values, with no duplicates
type 'a t = ('a, unit) Utils.Prelude.Hashtbl.t
val empty : ?size:int -> unit -> 'a t
Makes an empty Hashset
val mem : 'a t -> 'a -> bool
Checks if an element is in the set
val add : 'a t -> 'a -> unit
Adds an element to the set
val remove : 'a t -> 'a -> unit
Removes an element from the set
val length : 'a t -> int
Returns the size of the set
val iter : ('a -> unit) -> ('a, unit) Utils.Prelude.Hashtbl.t -> unit
Applies f
to each element of the set
val filter_in_place : 'a t -> ('a -> bool) -> unit
Filters the set in-place
val copy : 'a t -> ('a, unit) Utils.Prelude.Hashtbl.t
Clones the set
val to_seq : 'a t -> 'a Stdlib.Seq.t
Gives a sequence of all items in the set