module Make:
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).
| Parameters: |
|
val fold : 'a Container.T.t -> init:'b -> f:('b -> 'a -> 'b) -> 'bval count : 'a Container.T.t -> f:('a -> bool) -> intval iter : 'a Container.T.t -> f:('a -> unit) -> unitval length : 'a Container.T.t -> intval is_empty : 'a Container.T.t -> boolval exists : 'a Container.T.t -> f:('a -> bool) -> boolval mem : ?equal:('a -> 'a -> bool) -> 'a Container.T.t -> 'a -> boolval for_all : 'a Container.T.t -> f:('a -> bool) -> boolval find_map : 'a Container.T.t -> f:('a -> 'b option) -> 'b optionval find : 'a Container.T.t -> f:('a -> bool) -> 'a optionval to_list : 'a Container.T.t -> 'a listval to_array : 'a Container.T.t -> 'a array