Magical, Mystical JavaScript Transducers

Magical, Mystical JavaScript Transducers

To put it another way, we can think of a transducer as a function that takes a reducer and returns another reducer. If we were to describe that with Haskell types, it might look something like this:

What that means is: A transducer takes a reducer function as input, and transforms it in some way. In our average calculation problem, we have a reducer function at the end, .

Source: jrsinclair.com