
30 Sep
2005
30 Sep
'05
10:22 a.m.
Thanks. But how would I think about using scanl instead of foldl(or foldl') when I want is the sum, but not the progressive result. Once again show me that I need to throw away all imperative stuff. Oh, BTW, the reason I asked is that I was playing with python which has a reduce function that looks like foldl, and I tried to practice some FP style programming and came up with this issue. There is no scanl though, better use for loop and break.
This should work as expected: takeWhile (
__________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com