> In the case of foldr the end of the list has to be > reached before anything can be evaluated.
This is perhaps a good time to point out the common missconception that foldr can only be used to define functions that process the elements of lists in right-to-left order. For a discussion of this point, see section 5 of my JFP tutorial paper on foldr, which (amonst other things) shows how to sum a list of numbers in left-to-right order using foldr: http://www.cs.nott.ac.uk/~gmh/fold.pdf Graham +----------------------------------------------------------------------------+ | Dr Graham Hutton Email : [EMAIL PROTECTED] | | Foundations of Programming Group Web : http://www.cs.nott.ac.uk/~gmh | | School of Computer Science and IT | | University of Nottingham | | Jubilee Campus, Wollaton Road | | Nottingham NG8 1BB Phone : +44 (0)115 951 4220 | | United Kingdom Fax : +44 (0)115 951 4254 | +----------------------------------------------------------------------------+ _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell