This feeds the value in on the LEFT!!! This may seem counter intuitive, but
with this approach, a stream/iterator which is summed will have the same output
as applying the function one at a time in order to the input.
If we did the "lexigraphically correct" thing, which might be (f+g)(x) = f(g(x))
then we would wind up reversing the list in the sum.
(f1 + f2)(x) = f2(f1(x)) so that:
listOfFn.foldLeft(x) { (v, fn) => fn(v) } = (Monoid.sum(listOfFn))(x)
This feeds the value in on the LEFT!!! This may seem counter intuitive, but with this approach, a stream/iterator which is summed will have the same output as applying the function one at a time in order to the input. If we did the "lexigraphically correct" thing, which might be (f+g)(x) = f(g(x)) then we would wind up reversing the list in the sum. (f1 + f2)(x) = f2(f1(x)) so that: listOfFn.foldLeft(x) { (v, fn) => fn(v) } = (Monoid.sum(listOfFn))(x)