Transducers, Mappers and Reducers


This is an advanced functional programming topic, but I want to summarize only a couple of important points

  • Map and Reduce

First of all, the rationale for reducers was to allow for more performant seq operations by being able to utilize multiple cores and such…

  • Transducers

If you know C# very well, you should have learnt that Linq is good way to introduce functional programming techniques and F#. For example compare reduce with aggregate… and start to familiarize with the accumulator value pair.


Now this is a porting from JavaScript transducer to CSharp gist based on the .Net library.

The elegance of the transducer pattern is that transformers compose naturally to produce new transformers.  So we can chain as many transformers together as we like, and since we end up with one transformed reducer, we only iterate over the collection once. We don’t need to create intermediate copies of the data or iterate over it multiple times.

2 thoughts on “Transducers, Mappers and Reducers

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s