Hacker News new | ask | show | jobs
by dons 4860 days 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.