forall : ('a -> bool) -> 'a list -> bool
- SYNOPSIS
-
Tests a list to see if all its elements satisfy a predicate.
- DESCRIPTION
-
forall p [x1;...;xn] returns true if (p xi) is true for all xi in the
list. Otherwise it returns false. If the list is empty, this function always
returns true.
- FAILURE CONDITIONS
-
Never fails.
- EXAMPLE
-
# forall (fun x -> x <= 2) [0;1;2];;
val it : bool = true
# forall (fun x -> x <= 2) [1;2;3];;
val it : bool = false
- SEE ALSO
-
exists, find, tryfind, mem, assoc, rev_assoc.