If you don't know yet what a transducer is, or how they work, there are two amazing talks to get started, both by Rich Hickey: Transducers and Inside Transducers. I watched those talks a couple of times each, and I moderately use transducers in my projects; thus I have a decent understanding of transducers. Or so I thought.
Yesterday my coworker and I delved into reading the already implemented
transducers in clojure.core, and started pondering why some seq-operating
functions don't have a transducer counterpart. Multiple-collection
Probably missing because it doesn't fit the single-stream semantic very well.
drop-last? Those two can actually be implemented as
transducers by using a queue. And then…
cycle? Can we do cycle?
As it turned out, my knowledge of transducers was limited. I could use them, and
I got the idea behind them, but until I implemented one I lacked the perception
of the underlying machinery. Today I will guide you step by step through how we
cycle transducer, so you might also get a better comprehension of