Parameter Make.1-T
val length : [ `Define_using_fold | `Custom of 'a t -> int ]
The
length
argument toContainer.Make
specifies how to implement the container'slength
function.`Define_using_fold
means to definelength
via:length t ~f = Container.length ~fold t ~f
`Custom
overrides the default implementation, presumably with something more efficient. Several other functions returned byContainer.Make
are defined in terms oflength
, so passing in a more efficientlength
will improve their efficiency as well.
val iter : [ `Define_using_fold | `Custom of 'a t -> f:('a Base.Monad.Ident.t -> unit) -> unit ]
The
iter
argument toContainer.Make
specifies how to implement the container'siter
function.`Define_using_fold
means to defineiter
via:iter t ~f = Container.iter ~fold t ~f
`Custom
overrides the default implementation, presumably with something more efficient. Several other functions returned byContainer.Make
are defined in terms ofiter
, so passing in a more efficientiter
will improve their efficiency as well.
val fold : 'a t -> init:'accum -> f:('accum -> 'a Base.Monad.Ident.t -> 'accum) -> 'accum