package extlib
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=43fb3bf2989671af1769147b1171d080
sha512=dedd2bb4a63f2df9e451dbe6aede18d873489a8675f48ded09131f2af4d00dbeaecc8750039b2e4facb9f5f9b1b01c6b7accd392bf8ac5a3f2c801562ce5c4ee
doc/extlib/ExtArray/Array/index.html
Module ExtArray.ArraySource
New functions
Array reversal.
In-place array reversal. The array argument is updated.
Array.iter2 f [|a1; ...; an|] [|b1; ...; bn|] performs calls f a1 b1; ...; f an bn in that order.
Array.map2 f [|a1; ...; an|] [|b1; ...; bn|] creates new array [|f a1 b1; ...; f an bn|].
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).
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).
mem m a is true if and only if m is equal to an element of a.
Same as Array.mem but uses physical equality instead of structural equality to compare array elements.
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.
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.
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.
find_all is another name for Array.filter.
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
Compatibility functions
These functions are reimplemented in extlib when they are missing from the stdlib
Same as Array.for_all, but for a two-argument predicate.
Same as Array.exists, but for a two-argument predicate.
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.
*_seq functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions