1\DOC all 2 3\TYPE {all : ('a -> bool) -> 'a list -> bool} 4 5\SYNOPSIS 6Tests whether a predicate holds throughout a list. 7 8\DESCRIBE 9{all P [x1,...,xn]} equals {P x1 andalso .... andalso P xn}. 10{all P []} yields {true}. 11 12\FAILURE 13If {P x0,...,P x(j-1)} all evaluate to {true} and {P xj} raises an 14exception {e}, then {all P [x0,...,x(j-1),xj,...,xn]} raises {e}. 15 16\EXAMPLE 17{ 18- all (equal 3) [3,3,3]; 19> val it = true : bool 20 21- all (equal 3) []; 22> val it = true : bool 23 24- all (fn _ => raise Fail "") []; 25> val it = true : bool 26 27- all (fn _ => raise Fail "") [1]; 28! Uncaught exception: 29! Fail "" 30} 31 32 33\SEEALSO 34Lib.all2, Lib.exists, Lib.first. 35\ENDDOC 36