Sourceval rev : 'a array -> 'a array New functions
Array reversal.
Sourceval rev_in_place : 'a array -> unit In-place array reversal. The array argument is updated.
Sourceval iter2 : ('a -> 'b -> unit) -> 'a array -> 'b array -> unit Array.iter2 f [|a1; ...; an|] [|b1; ...; bn|] performs calls f a1 b1; ...; f an bn in that order.
Sourceval map2 : ('a -> 'b -> 'c) -> 'a array -> 'b array -> 'c array Array.map2 f [|a1; ...; an|] [|b1; ...; bn|] creates new array [|f a1 b1; ...; f an bn|].
Sourceval for_all : ('a -> bool) -> 'a array -> bool for_all p [a1; ...; an] checks if all elements of the array satisfy the predicate p. That is, it returns (p a1) && (p a2) && ... && (p an).
Sourceval exists : ('a -> bool) -> 'a array -> bool exists p [a1; ...; an] checks if at least one element of the array satisfies the predicate p. That is, it returns (p a1) || (p a2) || ... || (p an).
Sourceval mem : 'a -> 'a array -> bool mem m a is true if and only if m is equal to an element of a.
Sourceval memq : 'a -> 'a array -> bool Same as Array.mem but uses physical equality instead of structural equality to compare array elements.
Sourceval find : ('a -> bool) -> 'a array -> 'a find p a returns the first element of array a that satisfies the predicate p. Raise Not_found if there is no value that satisfies p in the array a.
Sourceval findi : ('a -> bool) -> 'a array -> int findi p a returns the index of the first element of array a that satisfies the predicate p. Raise Not_found if there is no value that satisfies p in the array a.
Sourceval filter : ('a -> bool) -> 'a array -> 'a array filter p a returns all the elements of the array a that satisfy the predicate p. The order of the elements in the input array is preserved.
Sourceval find_all : ('a -> bool) -> 'a array -> 'a array Sourceval partition : ('a -> bool) -> 'a array -> 'a array * 'a array partition p a returns a pair of arrays (a1, a2), where a1 is the array of all the elements of a that satisfy the predicate p, and a2 is the array of all the elements of a that do not satisfy p. The order of the elements in the input array is preserved.
Enumerations
Returns an enumeration of the elements of an array.
Build an array from an enumeration.
Compatibility functions
These functions are reimplemented in extlib when they are missing from the stdlib
Sourceval create_float : int -> float array Sourceval make_float : int -> float array Sourceval for_all2 : ('a -> 'b -> bool) -> 'a array -> 'b array -> bool Sourceval exists2 : ('a -> 'b -> bool) -> 'a array -> 'b array -> bool Old functions
These functions are already part of the Ocaml standard library and have not been modified. Please refer to the Ocaml Manual for documentation.
Sourceval length : 'a array -> int Sourceval get : 'a array -> int -> 'a Sourceval set : 'a array -> int -> 'a -> unit Sourceval make : int -> 'a -> 'a array Sourceval create : int -> 'a -> 'a array Sourceval init : int -> (int -> 'a) -> 'a array Sourceval make_matrix : int -> int -> 'a -> 'a array array Sourceval create_matrix : int -> int -> 'a -> 'a array array Sourceval append : 'a array -> 'a array -> 'a array Sourceval concat : 'a array list -> 'a array Sourceval sub : 'a array -> int -> int -> 'a array Sourceval copy : 'a array -> 'a array Sourceval fill : 'a array -> int -> int -> 'a -> unit Sourceval blit : 'a array -> int -> 'a array -> int -> int -> unit Sourceval to_list : 'a array -> 'a list Sourceval of_list : 'a list -> 'a array Sourceval iter : ('a -> unit) -> 'a array -> unit Sourceval map : ('a -> 'b) -> 'a array -> 'b array Sourceval iteri : (int -> 'a -> unit) -> 'a array -> unit Sourceval mapi : (int -> 'a -> 'b) -> 'a array -> 'b array Sourceval fold_left : ('a -> 'b -> 'a) -> 'a -> 'b array -> 'a Sourceval fold_right : ('b -> 'a -> 'a) -> 'b array -> 'a -> 'a Sourceval sort : ('a -> 'a -> int) -> 'a array -> unit Sourceval stable_sort : ('a -> 'a -> int) -> 'a array -> unit Sourceval fast_sort : ('a -> 'a -> int) -> 'a array -> unit Sourceval unsafe_get : 'a array -> int -> 'a Sourceval unsafe_set : 'a array -> int -> 'a -> unit *_seq functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions