Oops, somehow that reply by Scott Turner (which coincidentally contained the same example) hadn't appeared for me yet :) Anyway, seconded :)
On 26/06/05, Cale Gibbard <[EMAIL PROTECTED]> wrote: > Well, the case of the built-in numeric types is somewhat different, > but most functions automatically short circuit, since Haskell uses > lazy evaluation. > > For instance, it's perfectly okay to define > myAnd = foldr (&&) True > Note that this terminates on infinite lists which contain False as a value: > myAnd (False : repeat True) > will evaluate to False pretty much immediately. > > - Cale > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe