Module type Set.Creators_and_accessors_genericSource
include Base.Container.Generic
with type ('a, 'cmp, _) t := ('a, 'cmp) t
with type 'a elt := 'a elt
val length : (_, _) t -> intval is_empty : (_, _) t -> boolval fold_result :
('a, _) t ->
init:'acc ->
f:('acc -> 'a elt -> ('acc, 'e) Base.Result.t) ->
('acc, 'e) Base.Result.tval sum :
(module Container.Summable with type t = 'sum) ->
('a, _) t ->
f:('a elt -> 'sum) ->
'sumThe access_options type is used to make Accessors_generic flexible as to whether a comparator is required to be passed to certain functions.
val invariants : ('a, 'cmp, ('a, 'cmp) t -> bool) access_optionsval mem : ('a, 'cmp, ('a, 'cmp) t -> 'a elt -> bool) access_optionsoverride Container's mem
val add : ('a, 'cmp, ('a, 'cmp) t -> 'a elt -> ('a, 'cmp) t) access_optionsval remove : ('a, 'cmp, ('a, 'cmp) t -> 'a elt -> ('a, 'cmp) t) access_optionsval union :
('a, 'cmp, ('a, 'cmp) t -> ('a, 'cmp) t -> ('a, 'cmp) t) access_optionsval inter :
('a, 'cmp, ('a, 'cmp) t -> ('a, 'cmp) t -> ('a, 'cmp) t) access_optionsval diff :
('a, 'cmp, ('a, 'cmp) t -> ('a, 'cmp) t -> ('a, 'cmp) t) access_optionsval symmetric_diff :
('a,
'cmp,
('a, 'cmp) t ->
('a, 'cmp) t ->
('a elt, 'a elt) Base.Either.t Base.Sequence.t)
access_optionsval compare_direct :
('a, 'cmp, ('a, 'cmp) t -> ('a, 'cmp) t -> int) access_optionsval equal : ('a, 'cmp, ('a, 'cmp) t -> ('a, 'cmp) t -> bool) access_optionsval is_subset :
('a, 'cmp, ('a, 'cmp) t -> of_:('a, 'cmp) t -> bool) access_optionsval are_disjoint :
('a, 'cmp, ('a, 'cmp) t -> ('a, 'cmp) t -> bool) access_optionsmodule Named : sig ... endval fold_until :
('a, _) t ->
init:'acc ->
f:('acc -> 'a elt -> ('acc, 'final) Container.Continue_or_stop.t) ->
finish:('acc -> 'final) ->
'finalval split_le_gt :
('a, 'cmp, ('a, 'cmp) t -> 'a elt -> ('a, 'cmp) t * ('a, 'cmp) t)
access_optionsval split_lt_ge :
('a, 'cmp, ('a, 'cmp) t -> 'a elt -> ('a, 'cmp) t * ('a, 'cmp) t)
access_optionsval remove_index :
('a, 'cmp, ('a, 'cmp) t -> int -> ('a, 'cmp) t) access_optionsval to_sequence :
('a,
'cmp,
?order:[ `Increasing | `Decreasing ] ->
?greater_or_equal_to:'a elt ->
?less_or_equal_to:'a elt ->
('a, 'cmp) t ->
'a elt Base.Sequence.t)
access_optionsval binary_search :
('a,
'cmp,
('a, 'cmp) t ->
compare:('a elt -> 'key -> int) ->
Base.Binary_searchable.Which_target_by_key.t ->
'key ->
'a elt option)
access_optionsval binary_search_segmented :
('a,
'cmp,
('a, 'cmp) t ->
segment_of:('a elt -> [ `Left | `Right ]) ->
Base.Binary_searchable.Which_target_by_segment.t ->
'a elt option)
access_optionsval merge_to_sequence :
('a,
'cmp,
?order:[ `Increasing | `Decreasing ] ->
?greater_or_equal_to:'a elt ->
?less_or_equal_to:'a elt ->
('a, 'cmp) t ->
('a, 'cmp) t ->
('a elt, 'a elt) Base.Sequence.Merge_with_duplicates_element.t
Base.Sequence.t)
access_optionsval empty : ('a, 'cmp, ('a, 'cmp) t) create_optionsval singleton : ('a, 'cmp, 'a elt -> ('a, 'cmp) t) create_optionsval union_list : ('a, 'cmp, ('a, 'cmp) t list -> ('a, 'cmp) t) create_optionsval of_list : ('a, 'cmp, 'a elt list -> ('a, 'cmp) t) create_optionsval of_sequence :
('a, 'cmp, 'a elt Base.Sequence.t -> ('a, 'cmp) t) create_optionsval of_array : ('a, 'cmp, 'a elt array -> ('a, 'cmp) t) create_optionsval of_sorted_array :
('a, 'cmp, 'a elt array -> ('a, 'cmp) t Base.Or_error.t) create_optionsval of_sorted_array_unchecked :
('a, 'cmp, 'a elt array -> ('a, 'cmp) t) create_optionsval of_increasing_iterator_unchecked :
('a, 'cmp, len:int -> f:(int -> 'a elt) -> ('a, 'cmp) t) create_optionsval stable_dedup_list : ('a, _, 'a elt list -> 'a elt list) create_optionsval map :
('b, 'cmp, ('a, _) set -> f:('a -> 'b elt) -> ('b, 'cmp) t) create_optionsThe types of map and filter_map are subtle. The input set, ('a, _) set, reflects the fact that these functions take a set of *any* type, with any comparator, while the output set, ('b, 'cmp) t, reflects that the output set has the particular 'cmp of the creation function. The comparator can come in one of three ways, depending on which set module is used
Set.map-- comparator comes as an argumentSet.Poly.map-- comparator is polymorphic comparisonFoo.Set.map-- comparator isFoo.comparator
val filter_map :
('b, 'cmp, ('a, _) set -> f:('a -> 'b elt option) -> ('b, 'cmp) t)
create_optionsval of_tree : ('a, 'cmp, ('a, 'cmp) tree -> ('a, 'cmp) t) create_options