Re:Clojure's Transducers are as fundamental as function comp...
by tel on Sunday August 31, 2014 @10:22AM
(#8249350)
It's much, much more of the opposite situation. Function composition can easily operate at collection type inputs---indeed, that is exactly how transducers operate.
Transducers are a subset of functions. They cannot be generalizing them.
Function composition usually operates at non-collection type inputs. If you compose f and g, that usually means f takes some input and then g takes as input the output of g.
Transducers are a generalization of composition in the sense that it takes a collection of those inputs f would accepts.
So, in that sense, function composition could be a specific instance of transducers with number of inputs = 1.