All function
Fully qualified name: Std.Arrays.All
function All<'T>(predicate : ('T -> Bool), array : 'T[]) : Bool
Given an array and a predicate that is defined for the elements of the array, and checks if all elements of the array satisfy the predicate.
The type of array
elements.
A function from 'T
to Bool
that is used to check elements.
An array of elements over 'T
.
A Bool
value of the AND function of the predicate applied to all elements.
The following code checks whether all elements of the array are non-zero:
let allNonZero = All(x -> x != 0, [1, 2, 3, 4, 5]);