package base

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module 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.

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

Generic definitions of container operations in terms of fold.

module type Generic = sig ... end
module type Generic_with_creators = sig ... end
module type Summable = Summable
include Derived
type ('t, 'a, 'acc) fold = 't -> init:'acc -> f:('acc -> 'a -> 'acc) -> 'acc
type ('t, 'a) iter = 't -> f:('a -> unit) -> unit
type 't length = 't -> int
val iter : fold:('t, 'a, unit) fold -> ('t, 'a) iter
val count : fold:('t, 'a, int) fold -> 't -> f:('a -> bool) -> int
val min_elt : fold:('t, 'a, 'a option) fold -> 't -> compare:('a -> 'a -> int) -> 'a option
val max_elt : fold:('t, 'a, 'a option) fold -> 't -> compare:('a -> 'a -> int) -> 'a option
val length : fold:('t, _, int) fold -> 't -> int
val to_list : fold:('t, 'a, 'a list) fold -> 't -> 'a list
val sum : fold:('t, 'a, 'sum) fold -> (module Summable with type t = 'sum) -> 't -> f:('a -> 'sum) -> 'sum
val fold_result : fold:('t, 'a, 'acc) fold -> init:'acc -> f:('acc -> 'a -> ('acc, 'e) Result.t) -> 't -> ('acc, 'e) Result.t
val 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.

val is_empty : iter:('t, 'a) iter -> 't -> bool
val mem : iter:('t, 'a) iter -> 't -> 'a -> equal:('a -> 'a -> bool) -> bool
val exists : iter:('t, 'a) iter -> 't -> f:('a -> bool) -> bool
val for_all : iter:('t, 'a) iter -> 't -> f:('a -> bool) -> bool
val find : iter:('t, 'a) iter -> 't -> f:('a -> bool) -> 'a option
val find_map : iter:('t, 'a) iter -> 't -> f:('a -> 'b option) -> 'b option
val to_array : length:'t length -> iter:('t, 'a) iter -> 't -> 'a array
module 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:

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

Innovation. Community. Security.