package b0

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

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"