module type Accessors =sig..end
include Container.Generic_phantom
val mem : ('a, 'b) t -> 'a elt -> boolval add : ('a, 'comparator) t -> 'a elt -> ('a, 'comparator) tval remove : ('a, 'comparator) t -> 'a elt -> ('a, 'comparator) tval union : ('a, 'comparator) t -> ('a, 'comparator) t -> ('a, 'comparator) tval inter : ('a, 'comparator) t -> ('a, 'comparator) t -> ('a, 'comparator) tval diff : ('a, 'comparator) t -> ('a, 'comparator) t -> ('a, 'comparator) tval compare : ('a, 'comparator) t -> ('a, 'comparator) t -> intval equal : ('a, 'comparator) t -> ('a, 'comparator) t -> boolval subset : ('a, 'comparator) t -> ('a, 'comparator) t -> boolval fold_until : ('a, 'c) t ->
init:'b -> f:('b -> 'a elt -> [ `Continue of 'b | `Stop of 'b ]) -> 'bval fold_right : ('a, 'c) t -> init:'b -> f:('a elt -> 'b -> 'b) -> 'bval filter : ('a, 'comparator) t -> f:('a elt -> bool) -> ('a, 'comparator) tres = partition_tf set ~f then fst res are the elements on which f
produced true, and snd res are the elements on which f produces falseval partition_tf : ('a, 'comparator) t ->
f:('a elt -> bool) -> ('a, 'comparator) t * ('a, 'comparator) tval elements : ('a, 'b) t -> 'a elt listval min_elt : ('a, 'b) t -> 'a elt optionval min_elt_exn : ('a, 'b) t -> 'a eltval max_elt : ('a, 'b) t -> 'a elt optionval max_elt_exn : ('a, 'b) t -> 'a eltval choose : ('a, 'b) t -> 'a elt optionval choose_exn : ('a, 'b) t -> 'a eltval split : ('a, 'comparator) t ->
'a elt -> ('a, 'comparator) t * bool * ('a, 'comparator) tsplit x set produces a triple triple where fst3 triple is the set of elements
strictly less than x, snd3 triple = mem set x, and trd3 triple is the set of
elements strictly larger than x.val group_by : ('a, 'comparator) t ->
equiv:('a elt -> 'a elt -> bool) -> ('a, 'comparator) t listequiv is an equivalence predicate, then group_by set ~equiv produces a list
of equivalence classes (i.e., a set-theoretic quotient). E.g.,
let chars = Set.of_list ['A'; 'a'; 'b'; 'c'] in
let equiv c c' = Char.equal (Char.uppercase c) (Char.uppercase c') in
group_by chars ~equiv
produces
Set.of_list['A';'a']; Set.singleton 'b'; Set.singleton 'c'
Runs in O(n^2) time.
val find_exn : ('a, 'b) t -> f:('a elt -> bool) -> 'a eltval find_index : ('a, 'b) t -> int -> 'a elt optionval remove_index : ('a, 'comparator) t -> int -> ('a, 'comparator) ttype ('a, 'comparator) tree
tree t returns the underlying binary tree that represents the set. This is useful
if you want to marshal a set between processes. Since the set contains a closure,
it cannot be marshalled between processes that use different executables; however,
the underlying tree can.val to_tree : ('a, 'comparator) t -> ('a elt, 'comparator) tree