|
|
|
|
|
by fnordsensei
3871 days ago
|
|
You can transform map or filter into a transducer by decoupling the transformation from the data. When you call map, you usually call it on some data, or some stream. When you create a transducer, and you call for example (map inc), you're saying "whenever this transducer is applied, on whatever it is applied to, increase each unit by one". You can lug around the transformation itself as if it were an object, almost, separate from the data it's meant to transform. |
|