[Haskell-cafe] how to break foldl' ?

gary ng garyng2000 at yahoo.com
Fri Sep 30 06:33:34 EDT 2005


Hi,

say if I want to sum a list of numbers but only until
it hits a max limit. 

Currently, I control it through the function and
basically do nothing when the max is hit. However, if
the list is very long, would this mean the same
function would be called for the rest of the list
which can be a waste of cycle ? In an imperative
language, I just break/return in the middle of the
loop.

thanks for any help in advance.

gary


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


More information about the Haskell-Cafe mailing list