Make.Bitsettype t = Tezos_base.Bitset.tA bitset is a compact structure to store a set of integers.
val encoding : t Data_encoding.tval empty : tA bitset encoding the empty set.
val is_empty : t -> boolis_empty i is true if i is empty.
val mem : t -> int -> bool Error_monad.tzresultmem bitset i returns true iff i has been added in bitset.
This functions returns Invalid_position i if i is negative.
val add : t -> int -> t Error_monad.tzresultadd bitset i returns a new bitset which contains i in addition to the previous integers of bitset.
This functions returns Invalid_position i if i is negative.
val remove : t -> int -> t Error_monad.tzresultremove bitset i returns a new bitset in which i is removed from bitset.
This functions returns Invalid_position i if i is negative.
val from_list : int list -> t Error_monad.tzresultfrom_list positions folds add over the positions starting from empty. This function returns Invalid_position i if i is negative and appears in positions.
val to_list : t -> int listto_list t returns the list of integers in the bitset.
val fill : length:int -> t Error_monad.tzresultfill ~length is equivalent to setting all bits for positions in 0, length - 1 to one, or to from_list (0 -- size-1), or to from_z ((2 ^ length) - 1). But it's more efficient than folding on individual positions to set them.
The function returns Invalid_input "fill" if length is negative.
inter set_l set_r returns set which is result of the intersection of set_l and set_r.
diff set_l set_r returns a bitset containing integers in set_l that are not in set_r.
val occupied_size_in_bits : t -> intoccupied_size_in_bits bitset returns the current number of bits occupied by the bitset.
val cardinal : t -> intcardinat bitset returns the number of elements in the bitsest.
val from_z : Z.t -> t Error_monad.tzresultfrom_z builds a bitset from its integer representation. Returns Invalid_input "from_z" if the given argument is negative.