Hacker News new | ask | show | jobs
by LandR 2400 days ago
>> In every mainstream language I can think of `map foo myCollection` creates an intermediary map.

Language support for Transducers can fix this, you can compose functions like map / filter / reduce over a collection and only hit each item once.

1 comments

Even Java can do this. You only pay for another Collection<T> if you actually #collect the elements of a Stream<T>.