package base

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type ('a, 'phantom1, 'phantom2) t
type 'a elt
type (_, _, _) concat
val concat_of_array : 'a array -> ('a, _, _) concat
val of_list : 'a elt list -> ('a, _, _) t
val of_array : 'a elt array -> ('a, _, _) t
val concat : (('a, _, _) t, _, _) concat -> ('a, _, _) t
val fold : ('a, 'phantom1, 'phantom2) t -> init:'acc -> f:('acc -> 'a elt -> 'acc) -> 'acc
val iter : [ `Define_using_fold | `Custom of ('a, 'phantom1, 'phantom2) t -> f:('a elt -> unit) -> unit ]

The iter argument to Container.Make specifies 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.

val length : [ `Define_using_fold | `Custom of ('a, 'phantom1, 'phantom2) t -> int ]

The length argument to Container.Make specifies how to implement the container's length function. `Define_using_fold means to define length via:

length t ~f = Container.length ~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 length, so passing in a more efficient length will improve their efficiency as well.

val iteri : [ `Define_using_fold | `Custom of ('a, _, _) t -> f:(int -> 'a elt -> unit) -> unit ]
val foldi : [ `Define_using_fold | `Custom of ('a, _, _) t -> init:_ -> f:(int -> _ -> 'a elt -> _) -> _ ]
val init : [ `Define_using_of_array | `Custom of int -> f:(int -> 'a elt) -> ('a, _, _) t ]
val concat_mapi : [ `Define_using_concat | `Custom of ('a, _, _) t -> f:(int -> 'a elt -> ('b, _, _) t) -> ('b, _, _) t ]
OCaml

Innovation. Community. Security.