package containers

  1. Overview
  2. Docs
A modular, clean and powerful extension of the OCaml standard library

Install

Dune Dependency

Authors

Maintainers

Sources

v2.8.1.tar.gz
md5=d84e09c5d0abc501aa17cd502e31a038
sha512=8b832f4ada6035e80d81be0cfb7bdffb695ec67d465ed6097a144019e2b8a8f909095e78019c3da2d8181cc3cd730cd48f7519e87d3162442562103b7f36aabb

doc/containers.data/CCHashSet/Make/index.html

Module CCHashSet.MakeSource

Parameters

module E : ELEMENT

Signature

Sourcetype t
Sourcetype elt = E.t
Sourceval create : int -> t

create n makes a new set with the given capacity n.

Sourceval singleton : elt -> t

singleton x is the singleton {x}.

Sourceval clear : t -> unit

clear s removes all elements from s.

Sourceval copy : t -> t

Fresh copy.

Sourceval copy_into : into:t -> t -> unit

copy_into ~into s copies all elements of s into into.

Sourceval insert : t -> elt -> unit

insert s x adds x into s.

Sourceval remove : t -> elt -> unit

Remove the element, if it were in there.

Sourceval cardinal : t -> int

cardinal s returns the number of elements in s.

Sourceval mem : t -> elt -> bool

mem s x returns true iff x is in s.

Sourceval find_exn : t -> elt -> elt

find_exn s x returns y if x and y are equal, and mem s y.

Sourceval find : t -> elt -> elt option

Safe version of find_exn.

Sourceval inter : t -> t -> t

inter a b returns a ∩ b.

Sourceval inter_mut : into:t -> t -> unit

inter_mut ~into a changes into into a ∩ into.

Sourceval union : t -> t -> t

union a b returns a ∪ b.

Sourceval union_mut : into:t -> t -> unit

union_mut ~into a changes into into a ∪ into.

Sourceval diff : t -> t -> t

diff a b returns a - b.

Sourceval subset : t -> t -> bool

subset a b returns true if all elements of a are in b.

Sourceval equal : t -> t -> bool

equal a b is extensional equality (a and b have the same elements).

Sourceval for_all : (elt -> bool) -> t -> bool
Sourceval exists : (elt -> bool) -> t -> bool
Sourceval iter : (elt -> unit) -> t -> unit

Iterate on values.

Sourceval fold : ('a -> elt -> 'a) -> 'a -> t -> 'a

Fold on values.

Sourceval elements : t -> elt list

List of elements.

Sourceval of_list : elt list -> t
Sourceval to_seq : t -> elt sequence
Sourceval of_seq : elt sequence -> t
Sourceval add_seq : t -> elt sequence -> unit
Sourceval pp : ?sep:string -> elt printer -> t printer

pp pp_elt returns a set printer, given a printer for individual elements.

OCaml

Innovation. Community. Security.