package base

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

Generic definitions of foldi and iteri in terms of fold.

E.g., iteri ~fold t ~f = ignore (fold t ~init:0 ~f:((fun i x -> f i x; i + 1)[@local])).

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