Wed Aug 19 00:22:46 EDT 2015

Feldspar fusion trick

data Vector a = Indexed (Data Length) (Data Ix -> a)
map f (Indexed l ixf) = Indexed l (f . ixf)

A good idea of feldspar is to stick to C-like semantics:
for, while, if.

Something I noticed in RAI is the frequent use of (Int -> t) maps,
i.e. arrays of generated objects.  For loops are handy for this.

Instead of implementing Fold, it might be better to have indexable
vectors and Feldspar's for.

Actually, non-linear indexing is quite essential.

Good points:
- vector representation / fusion (keep indexing!)
- embracing for / while

In the references, an interesting language is SequenceL[2], which has
automatic lifting (in the sense of Conal Eliott's beautiful
See normalize-transpose[2].

[1] http://www.cse.chalmers.se/~ms/MemoCode.pdf
[2] https://en.wikipedia.org/wiki/SequenceL