include Accessors_generic
include Container.Generic_phantom
val length : (_, _) t ‑> int
val is_empty : (_, _) t ‑> bool
val fold_until : ('a, _) t ‑> init:'accum ‑> f:('accum ‑> 'a elt ‑> ('accum, 'stop) Container_intf.Continue_or_stop.t) ‑> ('accum, 'stop) Container_intf.Finished_or_stopped_early.t
val sum : (module Commutative_group.S with type t = 'sum) ‑> ('a, _) t ‑> f:('a elt ‑> 'sum) ‑> 'sum
type ('a, 'cmp, 'z) options
The options
type is used to make Accessors_generic
flexible as to whether a
comparator is required to be passed to certain functions.
val fold_until : ('a, _) t ‑> init:'b ‑> f:('b ‑> 'a elt ‑> ('b, 'stop) Continue_or_stop.t) ‑> ('b, 'stop) Finished_or_stopped_early.t
val 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) Merge_to_sequence_element.t Sequence.t) options
include Creators_generic with type (a, b, c) options := (a, b, c) options with type (a, b) t := (a, b) t with type (a, b) tree := (a, b) tree with type a elt := a elt with type cmp cmp := cmp cmp
val of_sorted_array : ('a, 'cmp, 'a elt array ‑> ('a, 'cmp) t Or_error.t) options
The 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 is Foo.comparator