3 ms·
`map` is the trivial case. There are plenty of loop compositions that are completely non-trivial to do by hand. That's why array fusion (see e.g. repa or vector
by dons 14y ago
`map` is the trivial case. There are plenty of loop compositions that are completely non-trivial to do by hand. That's why array fusion (see e.g. repa or vector) is a huge win.
foldl g . scanl y . concatMap x . filter h . unfoldr k
Fuse that by hand.
This is why we have optimizing compilers. They do what you could have done, only more often, and without mistakes.