Assume
f x y z = x*y*z
Then I expect to return the application of f three times with each member of the list
foldl ($) f [1,2,3]
Something like (((f 1) 2) 3) = 1*2*3 = 6
The function f
would be the accumulator and each iteration of the fold would apply one argument and return a partially applied function as the next accumulator.
Why doesn't this work? Is it because f
changes type while iterating?
As an aside: is there any other way to accomplish this type of function application?