Module Core_kernel.Container

Provides generic signatures for container data structures.

These signatures include functions (iter, fold, exists, for_all, ...) that you would expect to find in any container. Used by including Container.S0 or Container.S1 in the signature for every container-like data structure (Array, List, String, ...) to ensure a consistent interface.

These signatures extend signatures exported by Base.Container_intf.

include module type of sig ... end
type ('t, 'a, 'accum) fold = 't ‑> init:'accum ‑> f:('accum ‑> 'a ‑> 'accum) ‑> 'accum
type ('t, 'a) iter = 't ‑> f:('a ‑> unit) ‑> unit
val iter : fold:('t'a, unit) fold ‑> ('t'aiter
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'a, int) fold ‑> 't ‑> int
val to_list : fold:('t'a'a list) fold ‑> 't ‑> 'a list
val to_array : fold:('t'a'a list) fold ‑> 't ‑> 'a array
val sum : fold:('t'a'sumfold ‑> (module Base.Commutative_group.S with type t = 'sum) ‑> 't ‑> f:('a ‑> 'sum) ‑> 'sum
val fold_result : fold:('t'a'bfold ‑> init:'b ‑> f:('b ‑> 'a ‑> ('b'eBase.Result.t) ‑> 't ‑> ('b'eBase.Result.t
val fold_until : fold:('t'a'bfold ‑> init:'b ‑> f:('b ‑> 'a ‑> ('b'finalContinue_or_stop.t) ‑> finish:('b ‑> 'final) ‑> 't ‑> 'final
val is_empty : iter:('t'aiter ‑> 't ‑> bool
val exists : iter:('t'aiter ‑> 't ‑> f:('a ‑> bool) ‑> bool
val for_all : iter:('t'aiter ‑> 't ‑> f:('a ‑> bool) ‑> bool
val find : iter:('t'aiter ‑> 't ‑> f:('a ‑> bool) ‑> 'a option
val find_map : iter:('t'aiter ‑> 't ‑> f:('a ‑> 'b option) ‑> 'b option