by m12k · 6y ago · 0 comments
> Like pipes in UNIX, the functions are clever enough to be performant when composed together–we don’t traverse the whole list and generate a new list each time, each item is generated on demand. In fact, due to stream fusion, the code will be compiled into one fast loop.
I imagine it is hard to do the same optimization in a non-lazy language.
[1] http://journal.stuffwithstuff.com/2015/02/01/what-color-is-y...