4 ms·
What's so complex about transducers? (let [my-xf (comp (filter even?) (map inc))] (sequence my-xf [1 2 3 4 5])) => (3 5)
by raspasov 11y ago
What's so complex about transducers?
(let [my-xf (comp (filter even?) (map inc))]
(sequence my-xf [1 2 3 4 5]))
=> (3 5)
- j-pb 11y agoYeah but now try implementing a custom state-full transducer.
- raspasov 11y agoState-full things are always more complex, and I'd say their use is also niche (for example, state-full transducers where you can really shoot yourself in the foot since they grow infinitely in memory).
- divs1210 11y agoCan you help me update this[0] code to use transducers? [0] https://github.com/divs1210/difference-engine/blob/master/src/difference_engine/core.clj https://github.com/divs1210/difference-engine/blob/master/sr...