base

Full standard library replacement for OCaml
IN THIS PACKAGE
include Container.Generic
type 'a t
type 'a elt
val length : _ t -> int
val is_empty : _ t -> bool
val iter : 'a t -> f:( 'a elt -> unit ) -> unit
val fold : 'a t -> init:'accum -> f:( 'accum -> 'a elt -> 'accum ) -> 'accum
val fold_result : 'a t -> init:'accum -> f:( 'accum -> 'a elt -> ( 'accum, 'e ) Result.t ) -> ( 'accum, 'e ) Result.t
val fold_until : 'a t -> init:'accum -> f:( 'accum -> 'a elt -> ( 'accum, 'final ) Container.Continue_or_stop.t ) -> finish:( 'accum -> 'final ) -> 'final
val exists : 'a t -> f:( 'a elt -> bool ) -> bool
val for_all : 'a t -> f:( 'a elt -> bool ) -> bool
val count : 'a t -> f:( 'a elt -> bool ) -> int
val sum : (module Container.Summable with type t = 'sum) -> 'a t -> f:( 'a elt -> 'sum ) -> 'sum
val find : 'a t -> f:( 'a elt -> bool ) -> 'a elt option
val find_map : 'a t -> f:( 'a elt -> 'b option ) -> 'b option
val to_list : 'a t -> 'a elt list
val to_array : 'a t -> 'a elt array
val min_elt : 'a t -> compare:( 'a elt -> 'a elt -> int ) -> 'a elt option
val max_elt : 'a t -> compare:( 'a elt -> 'a elt -> int ) -> 'a elt option

These are all like their equivalents in Container except that an index starting at 0 is added as the first argument to f.

val foldi : 'a t -> init:_ -> f:( int -> _ -> 'a elt -> _ ) -> _
val iteri : 'a t -> f:( int -> 'a elt -> unit ) -> unit
val existsi : 'a t -> f:( int -> 'a elt -> bool ) -> bool
val for_alli : 'a t -> f:( int -> 'a elt -> bool ) -> bool
val counti : 'a t -> f:( int -> 'a elt -> bool ) -> int
val findi : 'a t -> f:( int -> 'a elt -> bool ) -> (int * 'a elt) option
val find_mapi : 'a t -> f:( int -> 'a elt -> 'b option ) -> 'b option