package lambdapi

  1. Overview
  2. Docs
module A = Stdlib.Array
include module type of struct include A end
type !'a t = 'a array
val length : 'a array -> int
val get : 'a array -> int -> 'a
val set : 'a array -> int -> 'a -> unit
val make : int -> 'a -> 'a array
val create : int -> 'a -> 'a array
  • deprecated Use Array.make/ArrayLabels.make instead.
val create_float : int -> float array
val make_float : int -> float array
  • deprecated Use Array.create_float/ArrayLabels.create_float instead.
val init : int -> (int -> 'a) -> 'a array
val make_matrix : int -> int -> 'a -> 'a array array
val create_matrix : int -> int -> 'a -> 'a array array
  • deprecated Use Array.make_matrix/ArrayLabels.make_matrix instead.
val append : 'a array -> 'a array -> 'a array
val concat : 'a array list -> 'a array
val sub : 'a array -> int -> int -> 'a array
val copy : 'a array -> 'a array
val fill : 'a array -> int -> int -> 'a -> unit
val blit : 'a array -> int -> 'a array -> int -> int -> unit
val to_list : 'a array -> 'a list
val of_list : 'a list -> 'a array
val iter : ('a -> unit) -> 'a array -> unit
val iteri : (int -> 'a -> unit) -> 'a array -> unit
val map : ('a -> 'b) -> 'a array -> 'b array
val mapi : (int -> 'a -> 'b) -> 'a array -> 'b array
val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b array -> 'a
val fold_left_map : ('a -> 'b -> 'a * 'c) -> 'a -> 'b array -> 'a * 'c array
val fold_right : ('b -> 'a -> 'a) -> 'b array -> 'a -> 'a
val iter2 : ('a -> 'b -> unit) -> 'a array -> 'b array -> unit
val map2 : ('a -> 'b -> 'c) -> 'a array -> 'b array -> 'c array
val for_all : ('a -> bool) -> 'a array -> bool
val exists : ('a -> bool) -> 'a array -> bool
val exists2 : ('a -> 'b -> bool) -> 'a array -> 'b array -> bool
val mem : 'a -> 'a array -> bool
val memq : 'a -> 'a array -> bool
val find_opt : ('a -> bool) -> 'a array -> 'a option
val find_map : ('a -> 'b option) -> 'a array -> 'b option
val split : ('a * 'b) array -> 'a array * 'b array
val combine : 'a array -> 'b array -> ('a * 'b) array
val sort : ('a -> 'a -> int) -> 'a array -> unit
val stable_sort : ('a -> 'a -> int) -> 'a array -> unit
val fast_sort : ('a -> 'a -> int) -> 'a array -> unit
val to_seq : 'a array -> 'a Stdlib.Seq.t
val to_seqi : 'a array -> (int * 'a) Stdlib.Seq.t
val of_seq : 'a Stdlib.Seq.t -> 'a array
val unsafe_get : 'a array -> int -> 'a
val unsafe_set : 'a array -> int -> 'a -> unit
module Floatarray : sig ... end
val for_all2 : ('a -> 'b -> bool) -> 'a array -> 'b array -> bool

for_all2 p a1 a2 checks if the corresponding elements of arrays a1 and a2 satisfy the predicate p. The Invalid_argument exception is raised if the arrays do not have the same size.

val pp : 'a Base.pp -> string -> 'a array Base.pp

pp elt sep ppf a prints the array a on the formatter ppf using sep as separator and elt for printing the elements.

val cmp : 'a Base.cmp -> 'a array Base.cmp

Comparison function on arrays.

val eq : 'a Base.eq -> 'a array Base.eq

eq eq_elt a1 a2 tests the equality of a1 and a2, comparing their elements with eq_elt.

val max_index : ?cmp:('a -> 'a -> int) -> 'a array -> int

max_index ?cmp a returns the index of the first maximum of array a according to comparison ?cmp. If cmp is not given, defaults to Stdlib.compare.

val max : ?cmp:('a -> 'a -> int) -> 'a array -> 'a

max ?cmp a returns the higher element according to comparison function ?cmp, using Stdlib.compare if not given, in array a.

val unzip : ('a * 'b) array -> 'a list * 'b list

unzip a is List.unzip (Array.to_list a).

val drop : int -> 'a array -> 'a array

drop n a discards the first n elements of a. The empty array is returned if n > length a.

OCaml

Innovation. Community. Security.