changeset 20443 | 84a624a8f773 |
parent 20348 | d59364649bcc |
child 20510 | 5e844572939d |
--- a/src/Pure/library.ML Thu Aug 31 02:59:08 2006 +0200 +++ b/src/Pure/library.ML Thu Aug 31 10:17:19 2006 +0200 @@ -543,10 +543,11 @@ (* (op @) [x1, ..., xn] ===> x1 @ (x2 ... @ (x[n-1] @ xn)) for n > 0, operators that associate to the right (not tail recursive)*) -fun foldr1 f l = - let fun itr [x] = x - | itr (x::l) = f(x, itr l) - in itr l end; +fun foldr1 f [] = raise Empty + | foldr1 f l = + let fun itr [x] = x + | itr (x::l) = f(x, itr l) + in itr l end; fun fold_index f = let