package core
Module Core.ContainerSource
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 struct include Base.Container end
Continue_or_stop.t is used by the f argument to fold_until in order to indicate whether folding should continue, or stop early.
include Derived
Source
val sum :
fold:('t, 'a, 'sum) fold ->
(module Base.Container.Summable with type t = 'sum) ->
't ->
f:('a -> 'sum) ->
'sumSource
val fold_result :
fold:('t, 'a, 'acc) fold ->
init:'acc ->
f:('acc -> 'a -> ('acc, 'e) Base.Result.t) ->
't ->
('acc, 'e) Base.Result.tSource
val fold_until :
fold:('t, 'a, 'acc) fold ->
init:'acc ->
f:('acc -> 'a -> ('acc, 'final) Base.Container.Continue_or_stop.t) ->
finish:('acc -> 'final) ->
't ->
'finalGeneric definitions of container operations in terms of iter and length.
The idiom for using Container.Make is to bind the resulting module and to explicitly import each of the functions that one wants: