Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> so they would not allocate an intermediate list

Not quite. Lazy sequences make it so that thinking about fusion/deforestation makes sense. This is an optimization the compiler can make. Naively, you still end up with as many allocations as before (just in a different order).

In Haskell, this sort of optimization is actually user-customizable using REWRITE RULES. And you get it for lists out of the box.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: