package orsetto
Install
Dune Dependency
Authors
Maintainers
Sources
sha512=9b654edb663ae697563f150824047052f3b1bf760398f24bce6350553f031f73c46b6337239a1acd871e61238597ea92046809e3358290ff14d6ba671b449085
doc/orsetto.cf/Cf_rbtree/Set/Create/index.html
Module Set.Create
A functor to create a Set
module.
Parameters
module E : Cf_relations.Order
Signature
val nil : t
The empty set.
Use min u
to return the ordinally least element in u
. Raises Not_found
if u
is empty.
Use min u
to return the ordinally greatest element in u
. Raises Not_found
if u
is empty.
val empty : t -> bool
Use empty u
to test whether u
is the empty set.
val size : t -> int
Use size u
to compute the size of u
.
Use compare u1 u2
to compare the sequence of elements in u1
and the sequence of elements in u2
in order of increasing ordinality. Two sets are ordinally equal if the sequences of their elements are ordinally equal.
Use put e u
to obtain a new set produced by inserting the element e
into u
. If s
already contains a member ordinally equal to e
then it is replaced by e
in the set returned.
Use clear e u
to obtain a new set produced by deleting the element in u
ordinally equal to the element e
. If there is no such element in the set, then the set is returned unchanged.
Use union u1 u2
to obtain a new set from the union of u1
and u2
. Elements of the new set belonging to the intersection are copied from u2
.
Use interset u1 u2
to obtain a new set from the intersection of u1
and u2
. All the elements in the new set are copied from u2
.
Use of_seq s
to consume a sequence s
and compose a new set by inserting each value produced in the order produced.
Use of_seq_incr s
to compose the set with elements in the sequence s
. Runs in linear time if the sequence c
is known to be in increasing order. Otherwise, there is an additional linear cost beyond of_seq s
.
Use of_seq_decr s
to compose the set with elements in the sequence s
. Runs in linear time if the sequence c
is known to be in decreasing order. Otherwise, there is an additional linear cost beyond of_seq s
.
Use to_seq_incr u
to produce the list of elements in u
in order of increasing ordinality.
Use to_seq_decr u
to produce the list of elements in u
in order of decreasing ordinality.
Use to_seq_nearest_decr e u
to obtain the element ordinally less than or equal to e
in u
. Raises Not_found
if u
is empty or all the keys are ordinally greater.