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/Container/index.html

Module Base.ContainerSource

Sourcemodule Continue_or_stop : sig ... end

Continue_or_stop.t is used by the f argument to fold_until in order to indicate whether folding should continue, or stop early.

Sourcemodule type S0 = sig ... end
Sourcemodule type S0_phantom = sig ... end
Sourcemodule type S0_with_creators = sig ... end
Sourcemodule type S1 = sig ... end
Sourcemodule type S1_phantom = sig ... end
Sourcemodule type S1_with_creators = sig ... end
Sourcemodule type Derived = sig ... end

Generic definitions of container operations in terms of fold.

Sourcemodule type Generic = sig ... end
Sourcemodule type Generic_with_creators = sig ... end
Sourcemodule type Summable = Summable
include Derived
Sourcetype ('t, 'a, 'acc) fold = 't -> init:'acc -> f:('acc -> 'a -> 'acc) -> 'acc
Sourcetype ('t, 'a) iter = 't -> f:('a -> unit) -> unit
Sourcetype 't length = 't -> int
Sourceval iter : fold:('t, 'a, unit) fold -> ('t, 'a) iter
Sourceval count : fold:('t, 'a, int) fold -> 't -> f:('a -> bool) -> int
Sourceval min_elt : fold:('t, 'a, 'a option) fold -> 't -> compare:('a -> 'a -> int) -> 'a option
Sourceval max_elt : fold:('t, 'a, 'a option) fold -> 't -> compare:('a -> 'a -> int) -> 'a option
Sourceval length : fold:('t, _, int) fold -> 't -> int
Sourceval to_list : fold:('t, 'a, 'a list) fold -> 't -> 'a list
Sourceval sum : fold:('t, 'a, 'sum) fold -> (module Summable with type t = 'sum) -> 't -> f:('a -> 'sum) -> 'sum
Sourceval fold_result : fold:('t, 'a, 'acc) fold -> init:'acc -> f:('acc -> 'a -> ('acc, 'e) Result.t) -> 't -> ('acc, 'e) Result.t
Sourceval fold_until : fold:('t, 'a, 'acc) fold -> init:'acc -> f:('acc -> 'a -> ('acc, 'final) Continue_or_stop.t) -> finish:('acc -> 'final) -> 't -> 'final

Generic definitions of container operations in terms of iter and length.

Sourceval is_empty : iter:('t, 'a) iter -> 't -> bool
Sourceval mem : iter:('t, 'a) iter -> 't -> 'a -> equal:('a -> 'a -> bool) -> bool
Sourceval exists : iter:('t, 'a) iter -> 't -> f:('a -> bool) -> bool
Sourceval for_all : iter:('t, 'a) iter -> 't -> f:('a -> bool) -> bool
Sourceval find : iter:('t, 'a) iter -> 't -> f:('a -> bool) -> 'a option
Sourceval find_map : iter:('t, 'a) iter -> 't -> f:('a -> 'b option) -> 'b option
Sourceval to_array : length:'t length -> iter:('t, 'a) iter -> 't -> 'a array
Sourcemodule Make (T : sig ... end) : S1 with type 'a t := 'a T.t

The idiom for using Container.Make is to bind the resulting module and to explicitly import each of the functions that one wants:

Sourcemodule Make0 (T : sig ... end) : S0 with type t := T.t and type elt := T.Elt.t
Sourcemodule Make_gen (T : sig ... end) : Generic with type ('a, 'phantom1, 'phantom2) t := ('a, 'phantom1, 'phantom2) T.t and type 'a elt := 'a T.elt
Sourcemodule Make_with_creators (T : sig ... end) : S1_with_creators with type 'a t := 'a T.t
Sourcemodule Make0_with_creators (T : sig ... end) : S0_with_creators with type t := T.t and type elt := T.Elt.t
Sourcemodule Make_gen_with_creators (T : sig ... end) : Generic_with_creators with type ('a, 'phantom1, 'phantom2) t := ('a, 'phantom1, 'phantom2) T.t and type 'a elt := 'a T.elt and type ('a, 'phantom1, 'phantom2) concat := ('a, 'phantom1, 'phantom2) T.concat
OCaml

Innovation. Community. Security.