Module Base.Container
include module type of sig ... end
module Continue_or_stop = Base__.Container_intf.Export.Continue_or_stop
Continue_or_stop.t
is used by thef
argument tofold_until
in order to indicate whether folding should continue, or stop early.
module type S0 = Base__.Container_intf.S0
module type S0_phantom = Base__.Container_intf.S0_phantom
module type S1 = Base__.Container_intf.S1
module type S1_phantom = Base__.Container_intf.S1_phantom
module type Generic = Base__.Container_intf.Generic
module type Generic_phantom = Base__.Container_intf.Generic_phantom
module type Summable = Base__.Container_intf.Summable
type ('t, 'a, 'accum) fold
= 't -> init:'accum -> f:('accum -> 'a -> 'accum) -> 'accum
type ('t, 'a) iter
= 't -> f:('a -> unit) -> unit
type 't length
= 't -> int
val iter : fold:('t, 'a, unit) fold -> ('t, 'a) iter
val count : fold:('t, 'a, int) fold -> 't -> f:('a -> bool) -> int
val min_elt : fold:('t, 'a, 'a option) fold -> 't -> compare:('a -> 'a -> int) -> 'a option
val max_elt : fold:('t, 'a, 'a option) fold -> 't -> compare:('a -> 'a -> int) -> 'a option
val length : fold:('t, _, int) fold -> 't -> int
val to_list : fold:('t, 'a, 'a list) fold -> 't -> 'a list
val sum : fold:('t, 'a, 'sum) fold -> (module Summable with type t = 'sum) -> 't -> f:('a -> 'sum) -> 'sum
val fold_result : fold:('t, 'a, 'b) fold -> init:'b -> f:('b -> 'a -> ('b, 'e) Result.t) -> 't -> ('b, 'e) Result.t
val fold_until : fold:('t, 'a, 'b) fold -> init:'b -> f:('b -> 'a -> ('b, 'final) Continue_or_stop.t) -> finish:('b -> 'final) -> 't -> 'final
val is_empty : iter:('t, 'a) iter -> 't -> bool
Generic definitions of container operations in terms of
iter
andlength
.
val exists : iter:('t, 'a) iter -> 't -> f:('a -> bool) -> bool
val for_all : iter:('t, 'a) iter -> 't -> f:('a -> bool) -> bool
val find : iter:('t, 'a) iter -> 't -> f:('a -> bool) -> 'a option
val find_map : iter:('t, 'a) iter -> 't -> f:('a -> 'b option) -> 'b option
val to_array : length:'t length -> iter:('t, 'a) iter -> 't -> 'a array