module type Make_arg =sig
..end
type 'a
t
val fold : 'a t ->
init:'accum -> f:('accum -> 'a -> 'accum) -> 'accum
val iter : [ `Custom of 'a t -> f:('a -> unit) -> unit
| `Define_using_fold ]
iter
argument to Container.Make
says how to implement the container's iter
function. `Define_using_fold
means to define iter
via:
iter t ~f = Container.iter ~fold t ~f
`Custom
overrides the default implementation, presumably with something more
efficient. Several other functions returned by Container.Make
are defined in
terms of iter
, so passing in a more efficient iter
will improve their efficiency
as well.