package base

  1. Overview
  2. Docs
Full standard library replacement for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.3.tar.gz
md5=2100b0ed13fecf43be86ed45c5b2cc4d
sha512=628610caff7e124631870fa1e29661caac28bdfdb18750ee43b868037da3d65d6dd9023b4be7c4c52405679efb5e865a6632d95606a22b28a36636a6bf706ef3

doc/base/Base/Indexed_container/Make_with_creators/argument-1-T/index.html

Parameter Make_with_creators.T

type 'a t
val of_list : 'a list -> 'a t
val of_array : 'a array -> 'a t
val concat : 'a t t -> 'a t
val fold : 'a t -> init:'acc -> f:('acc -> 'a -> 'acc) -> 'acc
val iter : [ `Define_using_fold | `Custom of 'a t -> f:('a -> 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 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 -> unit) -> unit ]
val foldi : [ `Define_using_fold | `Custom of 'a t -> init:_ -> f:(int -> _ -> 'a -> _) -> _ ]
val init : [ `Define_using_of_array | `Custom of int -> f:(int -> 'a) -> 'a t ]
val concat_mapi : [ `Define_using_concat | `Custom of 'a t -> f:(int -> 'a -> 'b t) -> 'b t ]
OCaml

Innovation. Community. Security.