|
|
|
|
|
by aoeuasdf1
4014 days ago
|
|
The way you explain it, it's no different from functions and function composition; in which case, why invent new vocabulary? I do remember looking into them before and translating them into Haskell and they ended up not being identical to functions in the trivial sense that you suggest, but I forget how. |
|
For instance if we have (map inc [1 2]), there exists a transducer function T such that:
I.e. we can somehow do "map inc" using reduce.Okay?
Now, the clever thing is this: why don't we allow map to be called without the list argument? Just let it be called like this:
This looks like partial application, right? Now what would partial application do? It would curry the "inc", returning a function of one argument that takes a list, i.e.: But Hickey did something clever; he overloaded functions like map so that (map inc) returns T! The cool thing is that this (map inc) composes with other functions of its kind. So you can compose together the transducers of list processing operations, which are then put into effect inside a single reduce, and the behavior is like the composition of the original list processors.It's like a linear operator; like LaPlace. Composition of entire list operations in the regular domain corresponds to composition of operations on individual elements in the "t-domain".