Base.Container
module Continue_or_stop : sig ... 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.
module type S0 = sig ... end
module type S0_phantom = sig ... end
module type S0_with_creators = sig ... end
module type S1 = sig ... end
module type S1_phantom = sig ... end
module type S1_with_creators = sig ... end
module type Derived = sig ... end
Generic definitions of container operations in terms of fold
.
module type Generic = sig ... end
module type Generic_with_creators = sig ... end
include Derived
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 fold_until :
fold:('t, 'a, 'acc) fold ->
init:'acc ->
f:('acc -> 'a -> ('acc, 'final) Continue_or_stop.t) ->
finish:('acc -> 'final) ->
't ->
'final
Generic definitions of container operations in terms of iter
and length
.
val is_empty : iter:('t, 'a) iter -> 't -> bool
val mem : iter:('t, 'a) iter -> 't -> 'a -> equal:('a -> 'a -> bool) -> bool
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
The idiom for using Container.Make
is to bind the resulting module and to explicitly import each of the functions that one wants:
module Make_with_creators
(T : sig ... end) :
S1_with_creators with type 'a t := 'a T.t
module Make0_with_creators
(T : sig ... end) :
S0_with_creators with type t := T.t and type elt := T.Elt.t
module Make_gen_with_creators
(T : sig ... end) :
Generic_with_creators
with type ('a, 'phantom) t := ('a, 'phantom) T.t
and type 'a elt := 'a T.elt
and type ('a, 'phantom) concat := ('a, 'phantom) T.concat