module Container:sig..end
Container.Make is to bind the resulting module and to explicitly
import each of the functions that one wants:
module C = Container.Make (struct ... end)
let count = C.count
let exists = C.exists
let find = C.find
...
This is preferable to:
include Container.Make (struct ... end)
because the include makes it to easy to shadow specialized implementations of
container functions (length being a common one).
Container.Make implements iter in terms of fold, which is often slower than
implementing iter directly.
module type T =sig..end
val fold_count : ('a -> init:int -> f:(int -> 'b -> int) -> 'c) -> 'a -> f:('b -> bool) -> 'cmodule Make:
Container.Make is to bind the resulting module and to explicitly
import each of the functions that one wants:
module type S0 =sig..end
module type S0_phantom =sig..end
module type S1 =sig..end
module type S1_phantom =sig..end
module type S1_phantom_invariant =sig..end
module type Generic =sig..end
module type Generic_phantom =sig..end
module Check:
module Check_S0:
module Check_S0_phantom:
module Check_S1:
type phantom
module Check_S1_phantom:functor (M:S1_phantom) ->Check(sigtype'at =('a, Container.phantom) M.tend)(sigtype'at ='aend)(M)
module Check_S1_phantom_invariant:functor (M:S1_phantom_invariant) ->Check(sigtype'at =('a, Container.phantom) M.tend)(sigtype'at ='aend)(M)
Container.Make is to bind the resulting module and to explicitly
import each of the functions that one wants:
module C = Container.Make (struct ... end)
let count = C.count
let exists = C.exists
let find = C.find
...
This is preferable to:
include Container.Make (struct ... end)
because the include makes it to easy to shadow specialized implementations of
container functions (length being a common one).
Container.Make implements iter in terms of fold, which is often slower than
implementing iter directly.
Checks whether the provided element is there using the default equality test, using
the provided equal function if it is not
fold t ~init ~f returns f (... f (f (f init e1) e2) e3 ...) en, where e1..en
are the elements of t
Returns true if and only if there exists an element for which the provided
function evaluates to true. This is a short-circuiting operation.
Returns true if and only if the provided function evaluates to true for all
elements. This is a short-circuiting operation.
Returns the number of elements for which the provided function evaluates to true.
Returns as an option the first element for which f evaluates to true.
Returns the first evaluation of f that returns Some, and returns None if there
is no such element.
Checks whether the provided element is there using the default equality test, using
the provided equal function if it is not
fold t ~init ~f returns f (... f (f (f init e1) e2) e3 ...) en, where e1..en
are the elements of t
Returns true if and only if there exists an element for which the provided
function evaluates to true. This is a short-circuiting operation.
Returns true if and only if the provided function evaluates to true for all
elements. This is a short-circuiting operation.
Returns the number of elements for which the provided function evaluates to true.
Returns as an option the first element for which f evaluates to true.
Returns the first evaluation of f that returns Some, and returns None if there
is no such element.
Checks whether the provided element is there, using polymorphic compare if equal
is not provided
fold t ~init ~f returns f (... f (f (f init e1) e2) e3 ...) en, where e1..en
are the elements of t
Returns true if and only if there exists an element for which the provided
function evaluates to true. This is a short-circuiting operation.
Returns true if and only if the provided function evaluates to true for all
elements. This is a short-circuiting operation.
Returns the number of elements for which the provided function evaluates to true.
Returns as an option the first element for which f evaluates to true.
Returns the first evaluation of f that returns Some, and returns None if there
is no such element.
Checks whether the provided element is there, using polymorphic compare if equal
is not provided
fold t ~init ~f returns f (... f (f (f init e1) e2) e3 ...) en, where e1..en
are the elements of t
Returns true if and only if there exists an element for which the provided
function evaluates to true. This is a short-circuiting operation.
Returns true if and only if the provided function evaluates to true for all
elements. This is a short-circuiting operation.
Returns the number of elements for which the provided function evaluates to true.
Returns as an option the first element for which f evaluates to true.
Returns the first evaluation of f that returns Some, and returns None if there
is no such element.
Checks whether the provided element is there, using polymorphic compare if equal
is not provided
fold t ~init ~f returns f (... f (f (f init e1) e2) e3 ...) en, where e1..en
are the elements of t
Returns true if and only if there exists an element for which the provided
function evaluates to true. This is a short-circuiting operation.
Returns true if and only if the provided function evaluates to true for all
elements. This is a short-circuiting operation.
Returns the number of elements for which the provided function evaluates to true.
Returns as an option the first element for which f evaluates to true.
Returns the first evaluation of f that returns Some, and returns None if there
is no such element.