Core.ContainerProvides 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 endmodule Export = Base.Container.Exportinclude module type of struct include Export endmodule Continue_or_stop = Base.Container.Continue_or_stopContinue_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 Summable__bits64 = Base.Container.Summablemodule type Summable__bits64__local = Base.Container.Summablemodule type Summable__bits32 = Base.Container.Summablemodule type Summable__bits32__local = Base.Container.Summablemodule type Summable__word = Base.Container.Summablemodule type Summable__word__local = Base.Container.Summablemodule type Summable__float64 = Base.Container.Summablemodule type Summable__float64__local = Base.Container.Summablemodule type Summable__float32 = Base.Container.Summablemodule type Summable__float32__local = Base.Container.Summablemodule type Summable__value_or_null = Base.Container.Summablemodule type Summable__value_or_null__local = Base.Container.Summablemodule type Summable__'value_value' = Base.Container.Summablemodule type Summable__'value_value'__local = Base.Container.Summablemodule type Summable__'value_value_value' = Base.Container.Summablemodule type Summable__'value_value_value'__local = Base.Container.Summablemodule type Summable__'value_value_value_value' = Base.Container.Summablemodule type Summable__'value_value_value_value'__local =
Base.Container.Summablemodule type Summable__value = Base.Container.Summable__valuemodule type Summable__value__local = Base.Container.Summable__value__localmodule type Summable__'value_mod_external64' =
Base.Container.Summable__'value_mod_external64'module type Summable__'value_mod_external64'__local =
Base.Container.Summable__'value_mod_external64'__localmodule type Summable = Base.Container.Summablemodule type Summable__local = Base.Container.Summable__localmodule type Generic_types__''value'' = Base.Container.Generic_types__''value''module type Generic_types__''value_or_null'' =
Base.Container.Generic_types__''value_or_null''module type Generic_types__'''value_mod_external64''' =
Base.Container.Generic_types__'''value_mod_external64'''module type Generic_types__''base'' = Base.Container.Generic_types__''base''module type Generic_types__''base_with_ext'' =
Base.Container.Generic_types__''base_with_ext''module type Generic_types = Base.Container.Generic_typesinclude sig ... endmodule type Generic_without_mem__''value'' =
Base.Container.Generic_without_mem__''value''module type Generic__''value'' = Base.Container.Generic__''value''module type Generic_for_s0__''value'' =
Base.Container.Generic_for_s0__''value''Like Generic, but mem does not accept an equal function, since Make0 already takes Elt.equal.
module type Generic_without_mem__''value_or_null'' =
Base.Container.Generic_without_mem__''value_or_null''module type Generic__''value_or_null'' =
Base.Container.Generic__''value_or_null''module type Generic_for_s0__''value_or_null'' =
Base.Container.Generic_for_s0__''value_or_null''Like Generic, but mem does not accept an equal function, since Make0 already takes Elt.equal.
module type Generic_without_mem__'''value_mod_external64''' =
Base.Container.Generic_without_mem__'''value_mod_external64'''module type Generic__'''value_mod_external64''' =
Base.Container.Generic__'''value_mod_external64'''module type Generic_for_s0__'''value_mod_external64''' =
Base.Container.Generic_for_s0__'''value_mod_external64'''Like Generic, but mem does not accept an equal function, since Make0 already takes Elt.equal.
module type Generic_without_mem__''base_with_ext'' =
Base.Container.Generic_without_mem__''base_with_ext''module type Generic_without_mem = Base.Container.Generic_without_memmodule type Generic__''base_with_ext'' =
Base.Container.Generic__''base_with_ext''module type Generic_for_s0__''base_with_ext'' =
Base.Container.Generic_for_s0__''base_with_ext''Like Generic, but mem does not accept an equal function, since Make0 already takes Elt.equal.
module type Generic_for_s0 = Base.Container.Generic_for_s0module type Generic_without_mem__''value''__stack =
Base.Container.Generic_without_mem__''value''__stackmodule type Generic__''value''__stack =
Base.Container.Generic__''value''__stackmodule type Generic_for_s0__''value''__stack =
Base.Container.Generic_for_s0__''value''__stackLike Generic, but mem does not accept an equal function, since Make0 already takes Elt.equal.
module type Generic_without_mem__''value_or_null''__stack =
Base.Container.Generic_without_mem__''value_or_null''__stackmodule type Generic__''value_or_null''__stack =
Base.Container.Generic__''value_or_null''__stackmodule type Generic_for_s0__''value_or_null''__stack =
Base.Container.Generic_for_s0__''value_or_null''__stackLike Generic, but mem does not accept an equal function, since Make0 already takes Elt.equal.
module type Generic_without_mem__'''value_mod_external64'''__stack =
Base.Container.Generic_without_mem__'''value_mod_external64'''__stackmodule type Generic__'''value_mod_external64'''__stack =
Base.Container.Generic__'''value_mod_external64'''__stackmodule type Generic_for_s0__'''value_mod_external64'''__stack =
Base.Container.Generic_for_s0__'''value_mod_external64'''__stackLike Generic, but mem does not accept an equal function, since Make0 already takes Elt.equal.
module type Generic_without_mem__''base_with_ext''__stack =
Base.Container.Generic_without_mem__''base_with_ext''__stackmodule type Generic_without_mem__stack =
Base.Container.Generic_without_mem__stackmodule type Generic__''base_with_ext''__stack =
Base.Container.Generic__''base_with_ext''__stackmodule type Generic_for_s0__''base_with_ext''__stack =
Base.Container.Generic_for_s0__''base_with_ext''__stackLike Generic, but mem does not accept an equal function, since Make0 already takes Elt.equal.
module type Generic_for_s0__stack = Base.Container.Generic_for_s0__stackinclude sig ... endmodule type Generic = Base.Container.Genericmodule type S0__''value'' = Base.Container.S0__''value''Signature for monomorphic container - a container for a specific element type, e.g., string, which is a container of characters (type elt = char) and never of anything else.
module type S0__'''value_mod_external64''' =
Base.Container.S0__'''value_mod_external64'''Signature for monomorphic container - a container for a specific element type, e.g., string, which is a container of characters (type elt = char) and never of anything else.
module type S0__''base_with_ext'' = Base.Container.S0__''base_with_ext''Signature for monomorphic container - a container for a specific element type, e.g., string, which is a container of characters (type elt = char) and never of anything else.
module type S0 = Base.Container.S0module type S0_phantom__''value'' = Base.Container.S0_phantom__''value''module type S0_phantom__'''value_mod_external64''' =
Base.Container.S0_phantom__'''value_mod_external64'''module type S0_phantom__''base_with_ext'' =
Base.Container.S0_phantom__''base_with_ext''module type S0_phantom = Base.Container.S0_phantommodule type Generic__stack = Base.Container.Generic__stackmodule type S0__''value''__stack = Base.Container.S0__''value''__stackSignature for monomorphic container - a container for a specific element type, e.g., string, which is a container of characters (type elt = char) and never of anything else.
module type S0__'''value_mod_external64'''__stack =
Base.Container.S0__'''value_mod_external64'''__stackSignature for monomorphic container - a container for a specific element type, e.g., string, which is a container of characters (type elt = char) and never of anything else.
module type S0__''base_with_ext''__stack =
Base.Container.S0__''base_with_ext''__stackSignature for monomorphic container - a container for a specific element type, e.g., string, which is a container of characters (type elt = char) and never of anything else.
module type S0__stack = Base.Container.S0__stackmodule type S0_phantom__''value''__stack =
Base.Container.S0_phantom__''value''__stackmodule type S0_phantom__'''value_mod_external64'''__stack =
Base.Container.S0_phantom__'''value_mod_external64'''__stackmodule type S0_phantom__''base_with_ext''__stack =
Base.Container.S0_phantom__''base_with_ext''__stackmodule type S0_phantom__stack = Base.Container.S0_phantom__stackinclude sig ... endmodule type S1__''value'' = Base.Container.S1__''value''module type S1_phantom__''value'' = Base.Container.S1_phantom__''value''module type Creators__''value'' = Base.Container.Creators__''value''module type Generic_with_creators__''value'' =
Base.Container.Generic_with_creators__''value''module type Generic_with_creators_for_s0__''value'' =
Base.Container.Generic_with_creators_for_s0__''value''Like Generic_with_creators, but mem does not accept an equal function, since Make0_with_creators already takes Elt.equal.
module type S1__''value_or_null'' = Base.Container.S1__''value_or_null''module type S1_phantom__''value_or_null'' =
Base.Container.S1_phantom__''value_or_null''module type Creators__''value_or_null'' =
Base.Container.Creators__''value_or_null''module type Generic_with_creators__''value_or_null'' =
Base.Container.Generic_with_creators__''value_or_null''module type Generic_with_creators_for_s0__''value_or_null'' =
Base.Container.Generic_with_creators_for_s0__''value_or_null''Like Generic_with_creators, but mem does not accept an equal function, since Make0_with_creators already takes Elt.equal.
module type S1__'''value_mod_external64''' =
Base.Container.S1__'''value_mod_external64'''module type S1_phantom__'''value_mod_external64''' =
Base.Container.S1_phantom__'''value_mod_external64'''module type Creators__'''value_mod_external64''' =
Base.Container.Creators__'''value_mod_external64'''module type Generic_with_creators__'''value_mod_external64''' =
Base.Container.Generic_with_creators__'''value_mod_external64'''module type Generic_with_creators_for_s0__'''value_mod_external64''' =
Base.Container.Generic_with_creators_for_s0__'''value_mod_external64'''Like Generic_with_creators, but mem does not accept an equal function, since Make0_with_creators already takes Elt.equal.
module type S1__''base_with_ext'' = Base.Container.S1__''base_with_ext''module type S1 = Base.Container.S1module type S1_phantom__''base_with_ext'' =
Base.Container.S1_phantom__''base_with_ext''module type S1_phantom = Base.Container.S1_phantommodule type Creators__''base_with_ext'' =
Base.Container.Creators__''base_with_ext''module type Creators = Base.Container.Creatorsmodule type Generic_with_creators__''base_with_ext'' =
Base.Container.Generic_with_creators__''base_with_ext''module type Generic_with_creators_for_s0__''base_with_ext'' =
Base.Container.Generic_with_creators_for_s0__''base_with_ext''Like Generic_with_creators, but mem does not accept an equal function, since Make0_with_creators already takes Elt.equal.
module type Generic_with_creators_for_s0 =
Base.Container.Generic_with_creators_for_s0module type S1__''value''__stack = Base.Container.S1__''value''__stackmodule type S1_phantom__''value''__stack =
Base.Container.S1_phantom__''value''__stackmodule type Creators__''value''__stack =
Base.Container.Creators__''value''__stackmodule type Generic_with_creators__''value''__stack =
Base.Container.Generic_with_creators__''value''__stackmodule type Generic_with_creators_for_s0__''value''__stack =
Base.Container.Generic_with_creators_for_s0__''value''__stackLike Generic_with_creators, but mem does not accept an equal function, since Make0_with_creators already takes Elt.equal.
module type S1__''value_or_null''__stack =
Base.Container.S1__''value_or_null''__stackmodule type S1_phantom__''value_or_null''__stack =
Base.Container.S1_phantom__''value_or_null''__stackmodule type Creators__''value_or_null''__stack =
Base.Container.Creators__''value_or_null''__stackmodule type Generic_with_creators__''value_or_null''__stack =
Base.Container.Generic_with_creators__''value_or_null''__stackmodule type Generic_with_creators_for_s0__''value_or_null''__stack =
Base.Container.Generic_with_creators_for_s0__''value_or_null''__stackLike Generic_with_creators, but mem does not accept an equal function, since Make0_with_creators already takes Elt.equal.
module type S1__'''value_mod_external64'''__stack =
Base.Container.S1__'''value_mod_external64'''__stackmodule type S1_phantom__'''value_mod_external64'''__stack =
Base.Container.S1_phantom__'''value_mod_external64'''__stackmodule type Creators__'''value_mod_external64'''__stack =
Base.Container.Creators__'''value_mod_external64'''__stackmodule type Generic_with_creators__'''value_mod_external64'''__stack =
Base.Container.Generic_with_creators__'''value_mod_external64'''__stackmodule type Generic_with_creators_for_s0__'''value_mod_external64'''__stack =
Base.Container.Generic_with_creators_for_s0__'''value_mod_external64'''__stackLike Generic_with_creators, but mem does not accept an equal function, since Make0_with_creators already takes Elt.equal.
module type S1__''base_with_ext''__stack =
Base.Container.S1__''base_with_ext''__stackmodule type S1__stack = Base.Container.S1__stackmodule type S1_phantom__''base_with_ext''__stack =
Base.Container.S1_phantom__''base_with_ext''__stackmodule type S1_phantom__stack = Base.Container.S1_phantom__stackmodule type Creators__''base_with_ext''__stack =
Base.Container.Creators__''base_with_ext''__stackmodule type Creators__stack = Base.Container.Creators__stackmodule type Generic_with_creators__''base_with_ext''__stack =
Base.Container.Generic_with_creators__''base_with_ext''__stackmodule type Generic_with_creators_for_s0__''base_with_ext''__stack =
Base.Container.Generic_with_creators_for_s0__''base_with_ext''__stackLike Generic_with_creators, but mem does not accept an equal function, since Make0_with_creators already takes Elt.equal.
module type Generic_with_creators_for_s0__stack =
Base.Container.Generic_with_creators_for_s0__stackinclude sig ... endmodule type Generic_with_creators = Base.Container.Generic_with_creatorsmodule type S0_with_creators__''value'' =
Base.Container.S0_with_creators__''value''module type S0_with_creators__''base_with_ext'' =
Base.Container.S0_with_creators__''base_with_ext''module type S0_with_creators = Base.Container.S0_with_creatorsmodule type S1_with_creators__''value'' =
Base.Container.S1_with_creators__''value''module type S1_with_creators__''value_or_null'' =
Base.Container.S1_with_creators__''value_or_null''module type S1_with_creators__''base_with_ext'' =
Base.Container.S1_with_creators__''base_with_ext''module type S1_with_creators = Base.Container.S1_with_creatorsmodule type Generic_with_creators__stack =
Base.Container.Generic_with_creators__stackmodule type S0_with_creators__''value''__stack =
Base.Container.S0_with_creators__''value''__stackmodule type S0_with_creators__''base_with_ext''__stack =
Base.Container.S0_with_creators__''base_with_ext''__stackmodule type S0_with_creators__stack = Base.Container.S0_with_creators__stackmodule type S1_with_creators__''value''__stack =
Base.Container.S1_with_creators__''value''__stackmodule type S1_with_creators__''value_or_null''__stack =
Base.Container.S1_with_creators__''value_or_null''__stackmodule type S1_with_creators__''base_with_ext''__stack =
Base.Container.S1_with_creators__''base_with_ext''__stackmodule type S1_with_creators__stack = Base.Container.S1_with_creators__stacktype ('t, ('a : any), ('acc : any), ('final : any)) fold_until =
't ->
init:'acc ->
f:('acc -> ('a -> ('acc, 'final) Continue_or_stop.t) @ local) @ local ->
(finish:('acc -> 'final) @ local ->
'final) @ localand ('t, ('a : any), ('acc : any), ('final : any)) fold_until__global__local =
't ->
init:'acc @ local ->
(f:
('acc @ local ->
('a ->
('acc, 'final) Continue_or_stop.t @ local) @ local) @ local ->
(finish:('acc @ local -> 'final @ local) @ local ->
'final @ local) @ local) @ localand ('t, ('a : any), ('acc : any), ('final : any)) fold_until__local__global =
't @ local ->
(init:'acc ->
(f:
('acc -> ('a @ local -> ('acc, 'final) Continue_or_stop.t) @ local) @ local ->
(finish:('acc -> 'final) @ local ->
'final) @ local) @ local) @ localand ('t, ('a : any), ('acc : any), ('final : any)) fold_until__local__local =
't @ local ->
(init:'acc @ local ->
(f:
('acc @ local ->
('a @ local ->
('acc, 'final) Continue_or_stop.t @ local) @ local) @ local ->
(finish:('acc @ local -> 'final @ local) @ local ->
'final @ local) @ local) @ local) @ localtype ('t, ('a : any), ('final : any)) iter_until =
't ->
f:('a -> (unit, 'final) Continue_or_stop.t) @ local ->
(finish:(unit -> 'final) @ local ->
'final) @ localand ('t, ('a : any), ('final : any)) iter_until__global__local =
't ->
f:('a -> (unit, 'final) Continue_or_stop.t @ local) @ local ->
(finish:(unit -> 'final @ local) @ local ->
'final @ local) @ localand ('t, ('a : any), ('final : any)) iter_until__local__global =
't @ local ->
(f:('a @ local -> (unit, 'final) Continue_or_stop.t) @ local ->
(finish:(unit -> 'final) @ local ->
'final) @ local) @ localand ('t, ('a : any), ('final : any)) iter_until__local__local =
't @ local ->
(f:('a @ local -> (unit, 'final) Continue_or_stop.t @ local) @ local ->
(finish:(unit -> 'final @ local) @ local ->
'final @ local) @ local) @ localmodule type Make_gen_arg = Base.Container.Make_gen_argmodule type Make_gen_arg__local = Base.Container.Make_gen_arg__localmodule type Make_arg = Base.Container.Make_argmodule type Make_arg__local = Base.Container.Make_arg__localmodule type Make0_arg = Base.Container.Make0_argmodule type Make0_arg__local = Base.Container.Make0_arg__localmodule type Make_common_with_creators_arg =
Base.Container.Make_common_with_creators_argmodule type Make_gen_with_creators_arg =
Base.Container.Make_gen_with_creators_argmodule type Make_with_creators_arg = Base.Container.Make_with_creators_argmodule type Make0_with_creators_arg = Base.Container.Make0_with_creators_argmodule type Derived__value = Base.Container.Derived__valuemodule type Derived__value_or_null = Base.Container.Derived__value_or_nullinclude sig ... endval fold_until :
't 'a 'acc 'final. fold:
('t ->
init:'acc ->
f:('acc -> ('a -> 'acc) @ local) @ local ->
'acc) ->
't ->
init:'acc ->
f:
('acc -> ('a -> ('acc, 'final) Base.Container.Continue_or_stop.t) @ local) @ local ->
(finish:('acc -> 'final) @ local ->
'final) @ localGeneric definitions of container operations in terms of fold.
E.g.: iter ~fold t ~f = fold t ~init:() ~f:(fun () a -> f a).
Generic definitions of container operations in terms of fold.
E.g.: iter ~fold t ~f = fold t ~init:() ~f:(fun () a -> f a).
val sum :
't 'a 'sum. fold:
('t ->
init:'sum ->
f:('sum -> ('a -> 'sum) @ local) @ local ->
'sum) ->
(module Base.Container.Summable with type t = 'sum) ->
't ->
f:('a -> 'sum) @ local ->
'sumGeneric definitions of container operations in terms of fold_until.
val fold :
't 'a 'acc. fold_until:
('t ->
init:'acc ->
f:
('acc ->
('a ->
('acc, 'acc) Base.Container.Continue_or_stop.t) @ local) @ local ->
(finish:('acc -> 'acc) @ local ->
'acc) @ local) ->
't ->
init:'acc ->
f:('acc -> ('a -> 'acc) @ local) @ local ->
'accval fold_result :
't 'a 'acc 'e. fold_until:
('t ->
init:'acc ->
f:
('acc ->
('a ->
('acc, ('acc, 'e) Result.t)
Base.Container.Continue_or_stop.t) @ local) @ local ->
(finish:('acc -> ('acc, 'e) Result.t) @ local ->
('acc, 'e) Result.t) @ local) ->
't ->
init:'acc ->
f:('acc -> ('a -> ('acc, 'e) Result.t) @ local) @ local ->
('acc, 'e) Result.tval iter_until :
't 'a 'final. fold_until:
('t ->
init:unit ->
f:
(unit ->
('a ->
(unit, 'final) Base.Container.Continue_or_stop.t) @ local) @ local ->
(finish:(unit -> 'final) @ local ->
'final) @ local) ->
't ->
f:('a -> (unit, 'final) Base.Container.Continue_or_stop.t) @ local ->
(finish:(unit -> 'final) @ local ->
'final) @ localGeneric definitions of container operations in terms of iter_until.
include sig ... endval iter_via_iter_until :
't 'a. iter_until:
('t ->
f:('a -> (unit, unit) Base.Container.Continue_or_stop.t) @ local ->
(finish:(unit -> unit) @ local ->
unit) @ local) ->
't ->
f:('a -> unit) @ local ->
unitval is_empty :
't 'a. iter_until:
('t ->
f:('a -> (unit, bool) Base.Container.Continue_or_stop.t) @ local ->
(finish:(unit -> bool) @ local ->
bool) @ local) ->
't ->
boolval mem :
't 'a. iter_until:
('t ->
f:('a -> (unit, bool) Base.Container.Continue_or_stop.t) @ local ->
(finish:(unit -> bool) @ local ->
bool) @ local) ->
't ->
'a ->
equal:('a -> ('a -> bool) @ local) @ local ->
boolval exists :
't 'a. iter_until:
('t ->
f:('a -> (unit, bool) Base.Container.Continue_or_stop.t) @ local ->
(finish:(unit -> bool) @ local ->
bool) @ local) ->
't ->
f:('a -> bool) @ local ->
boolval for_all :
't 'a. iter_until:
('t ->
f:('a -> (unit, bool) Base.Container.Continue_or_stop.t) @ local ->
(finish:(unit -> bool) @ local ->
bool) @ local) ->
't ->
f:('a -> bool) @ local ->
boolval find :
't 'a. iter_until:
('t ->
f:
('a -> (unit, 'a option) Base.Container.Continue_or_stop.t) @ local ->
(finish:(unit -> 'a option) @ local ->
'a option) @ local) ->
't ->
f:('a -> bool) @ local ->
'a optionval find_map :
't 'a 'b. iter_until:
('t ->
f:
('a -> (unit, 'b option) Base.Container.Continue_or_stop.t) @ local ->
(finish:(unit -> 'b option) @ local ->
'b option) @ local) ->
't ->
f:('a -> 'b option) @ local ->
'b optionGeneric definitons of container operations in terms of iter and length.
module Make = Base.Container.MakeThe idiom for using Container.Make is to bind the resulting module and to explicitly import each of the functions that one wants:
module Make0 = Base.Container.Make0module Make_gen = Base.Container.Make_genmodule Make_with_creators = Base.Container.Make_with_creatorsmodule Make0_with_creators = Base.Container.Make0_with_creatorsmodule Make_gen_with_creators = Base.Container.Make_gen_with_creatorsmodule type S0_permissions = Container_intf.S0_permissionsmodule type S1_permissions = Container_intf.S1_permissionsmodule type S1_with_creators_permissions =
Container_intf.S1_with_creators_permissions