3 ms·
Imo replies here all miss the point. The reason to use transducers instead of a for loop here is that it allows you to expose a library function which takes a
by Gormisdomai 7y ago
Imo replies here all miss the point.
The reason to use transducers instead of a for loop here is that it allows you to expose a library function which takes a transducer as input. It's hard to refactor the for loop above to allow someone consuming this function to specify additional things they want to aggregate due to an API change in the definition of the 'slang' type, but with transducers you just take one as an argument.