3 ms·
>> In every mainstream language I can think of `map foo myCollection` creates an intermediary map. Language support for Transducers can fix this, you can compo
by LandR 7y 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.
- erik_seaberg 7y agoEven Java can do this. You only pay for another Collection<T> if you actually #collect the elements of a Stream<T>.