package b0

  1. Overview
  2. Docs
Software construction and deployment kit

Install

dune-project
 Dependency

Authors

Maintainers

Sources

b0-0.0.6.tbz
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0

doc/b0.file/B0_ocaml/Code/Set/index.html

Module Code.SetSource

Sets of codes.

Note. These signatures are the same as those from Stdlib.Set.S but we restrict access to the module in case we want to switch to something less heavy weight for sets of two or three elements.

Sourcetype t

The type for sets of codes.

Sourceval empty : t

empty is the empty set of codes.

Sourceval is_empty : t -> bool

empty s is true iff s is empty.

Sourceval mem : t -> t -> bool

mem c s is true iff c is in s.

Sourceval subset : t -> t -> bool

subset s0 s1 is true iff s0 is a subset of s2.

Sourceval cardinal : t -> int

cardinal s is the number of elements in s.

Sourceval add : t -> t -> t

add c s is s with c added.

Sourceval singleton : t -> t

singelton c is a set made of c.

Sourceval remove : t -> t -> t

remove c s is s with c removed.

Sourceval union : t -> t -> t

union s0 s1 is the union of s0 and s1.

Sourceval inter : t -> t -> t

inter s0 s1 is the intersection of s0 and s1.

Sourceval diff : t -> t -> t

diff s0 s1 are the elements of s0 that are not in s2.

Sourceval min_elt : t -> t

min_elt s is the minimal element in s note that if Byte is in s then this is Byte.

Sourceval of_list : t list -> t

of_list cs is a set containing exactly cs.

Sourceval to_list : t -> t list

to_list s is the list of codes in s.

Sourceval iter : (t -> unit) -> t -> unit

iter f s iterates f over the elements of s.

Sourceval fold : (t -> 'acc -> 'acc) -> t -> 'acc -> 'acc

fold f s acc folds f over the elements of s starting with acc.

pp formats sets.

Sourceval pp_human : t B0_std.Fmt.t

pp_human is a sentence of the form "codes a, b, c"