package base

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Provides generic signatures for containers that support indexed iteration (iteri, foldi, ...). In principle, any container that has iter can also implement iteri, but the idea is that Indexed_container_intf should be included only for containers that have a meaningful underlying ordering.

module type Derived = sig ... end

Generic definitions of foldi and iteri in terms of fold.

module type Generic = sig ... end
module type Generic_with_creators = sig ... end
module type S0 = sig ... end
module type S0_with_creators = sig ... end
module type S1 = sig ... end
module type S1_with_creators = sig ... end
include Derived
val foldi : fold:('t -> init:'acc -> f:('acc -> 'a -> 'acc) -> 'acc) -> 't -> init:'acc -> f:(int -> 'acc -> 'a -> 'acc) -> 'acc
val iteri : fold:('t -> init:int -> f:(int -> 'a -> int) -> int) -> 't -> f:(int -> 'a -> unit) -> unit

Generic definitions of indexed container operations in terms of foldi.

val counti : foldi:('t -> init:int -> f:(int -> int -> 'a -> int) -> int) -> 't -> f:(int -> 'a -> bool) -> int

Generic definitions of indexed container operations in terms of iteri.

val existsi : iteri:('t -> f:(int -> 'a -> unit) -> unit) -> 't -> f:(int -> 'a -> bool) -> bool
val for_alli : iteri:('t -> f:(int -> 'a -> unit) -> unit) -> 't -> f:(int -> 'a -> bool) -> bool
val findi : iteri:('t -> f:(int -> 'a -> unit) -> unit) -> 't -> f:(int -> 'a -> bool) -> (int * 'a) option
val find_mapi : iteri:('t -> f:(int -> 'a -> unit) -> unit) -> 't -> f:(int -> 'a -> 'b option) -> 'b option
module Make (T : sig ... end) : S1 with type 'a t := 'a T.t
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, 'phantom1, 'phantom2) t := ('a, 'phantom1, 'phantom2) 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, '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.