Skip to main content
Version: Next

big_set

Lazily accessed sets

type t<elt> = big_map<elt, unit>

The type of the big sets is based on big_map.

let empty: <elt>t<elt>

The value Big_set.empty denotes the empty big set. In some contexts, it is useful to annotate it with its type, for example: (Big_set.empty as Big_set.t<int>).

let update: <elt>(_: elt) => (_: bool) => (_: t<elt>) => t<elt>

The call Big_set.update(elt, true, set) is a copy of the big set set containing the element elt. The call Big_set.update(elt, false, set) is a copy of the big set set where the element elt is absent.

let add: <elt>(_: elt) => (_: t<elt>) => t<elt>

The call Big_set.add(elt, set) is a big set containing all the elements of the big set set, plus the element elt.

let remove: <elt>(_: elt) => (_: t<elt>) => t<elt>

The call Big_set.remove(elt, set) is a copy of the set set without the element elt.

let literal: <elt>(_: list<elt>) => t<elt>

The call Big_set.literal(list([e1, ..., en])) is a big set containing exactly the elements in the list. Note: The list must be literal, not an expression (compile-time list of values).

let of_list: <elt>(_: list<elt>) => t<elt>

The call Big_set.of_list(elements) is a big set containing exactly the elements in the list elements. Note: Use Big_set.literal instead if using a literal list.

let mem: <elt>(_: elt) => (_: t<elt>) => bool

The call Big_set.mem(elt, set) is true if, and only if, the element elt belongs to the big set set.