Sun Aug 23 21:29:16 EDT 2015

Loop fusion for accumulating maps

Vector representation can now accomodate loop fusion for map.  It
would be interesting to allow loop fusion for accumulating maps.

How to generalize arrays to support this?

s ->
(s -> i -> m (s, o)) ->
(Int -> i) ->
(Int -> o)

Can't, because they are no longer random access.

This needs a separate data type.

As long as output state is not needed, this can be built on top of
Signal.  Composition is then composition of Signals.

For essential multipass it doesn't matter anyway.

Solve later...

EDIT: See also HATD code: (lazy) sequences as folds.