Not quite. A Clojure transducer from A to B is
pure function which takes As to lists of Bs. To apply it to a sequence of As you flatMap it, so you apply it to each A in sequence and get a sequence of Bs which you splice into your final resulting sequence. Maps and filters are special cases, for example
const mapTrans = fn => function* (x) {
yield fn(x);
};
const filterTrans = predicate => function* (x) {
if (predicate(x)) {
yield x;
}
};
const dupeTrans = n => function* (x) {
for (let i = 0; i < n; i++) {
yield x;
}
};
Clojure just observed that an isomorphism of these functions under Church encoding looked like f<B> -> f<A> for a special parametric type f, so could be composed with ordinary function composition, albeit backwards.
An RNN transducer is fundamentally three functions:
One takes a list of recent As to some C1.
Another takes a list of recent Bs to some C2.
A final one takes a C1 and C2 to a B.
Rather than mapping over each input independently the RNN-T is allowed to learn something about the relationship of recent outputs to the next output, and the relationship of nearby inputs. Clojure transducers thus have an order insensitivity that RNN transducers are allowed to be sensitive to.
An RNN transducer is fundamentally three functions:
One takes a list of recent As to some C1.
Another takes a list of recent Bs to some C2.
A final one takes a C1 and C2 to a B.
Rather than mapping over each input independently the RNN-T is allowed to learn something about the relationship of recent outputs to the next output, and the relationship of nearby inputs. Clojure transducers thus have an order insensitivity that RNN transducers are allowed to be sensitive to.