On Fri, 26 Jun 1998, S. Alexander Jacobson wrote:
| > myFoldl f s [] = s
| > myFoldl f s (x:xs) = f s (foldl f x xs)
| > total = 3 + (myFoldl (+) 3 [4..100000])
| > total = 3 + 4 + (myFoldl (+) 4 [5..100000])
The problem is parenthesis; the last expression should have been:
total = 3 + (4 + (myFoldl (+) 4 [5..100000]))
So there is no way to add 3 and 4, unless you require the runtime system
to look for associative operators partially applied to closures. Which is
undoable, in my opinion.
Regards,
Koen.
--
Koen Claessen,
[EMAIL PROTECTED],
http://www.cs.chalmers.se/~koen,
Chalmers University of Technology.