Mon Nov 13 09:54:20 EST 2017

Streams of functions : where does the loop go?

What I see a lot is the need to turn loops "inside out".  I.e. instead
of folding a function over a list of elements, what happens often is
to fold an element over a list of functions.

In C: parameterize a sequence of destination pointers.

The question is always: where does the loop go?

The answer should be: this is an optimization that should be arbitrary
to change.  We do want the programmer to specify where this goes to be
able to make efficiency tradeoffs, but we do not want to burden inner
functions with this.