getify / Functional-Light-JS

Pragmatic, balanced FP in JavaScript. @FLJSBook on twitter.
http://FLJSBook.com
Other
16.6k stars 1.95k forks source link

Tech Edit: Appendix A #81

Closed DrBoolean closed 7 years ago

DrBoolean commented 7 years ago

Nailed it! Very clear, great motivation and explanation.

Just to clear up some terminology:

reducer ::  (r -> b -> r)
transducer :: (r -> a -> r) -> (r -> b -> r)

So mapper/filterer (transducers) are Hof's that take a reducer and return a reducer.

And combination function = reducer (or semigroup if you want to take advantage of a centuries of math ;)

So the // TODO: fact-check if the transducer produces the reducer or is the reducer - it produces one.

And the term transducer-reducer could just be transducer