~/talk

Transducers

Talkat Strange Loop 2014 · 2014-09-17..09-19· [functional-programming, clojure]
slides:none on file

Claims that Clojure’s transducers make map/filter/mapcat into context-free transformations that compose left-to-right, avoid creating no intermediate collections, and run efficiently. Tools shown: transducer-returning map/filter/mapcat plus reuse sites like into/sequence/transduce/chan and channels/observables integration. Demonstrations include composing baggage-processing steps, early termination via reduced, completion/init semantics, and a working Clojure implementation that reuses the same transformation code across collections, lazy sequences, channels, and event streams.

AI-written summary · about

  1. 0:00What are They?
  2. 1:31What kinds of Processes?
  3. 3:56Transducers in the Real World
  4. 4:59Conveyances, sources, sinks are irrelevant
  5. 5:56Transformation in the Programming World
  6. 6:55Conveyances are everywhere
  7. 8:03No reuse
  8. 9:57Creating Transducers (def process-bags (comp (mapcatting unbundle-pallet) (filtering non-food?) (mapping label-heavy)))
  9. 11:25Using Transducers
  10. 14:44Transducible Processes
  11. 16:04Deriving Transducers
  12. 16:38Many list fns can be defined in terms of foldr • encapsulates the recursion • easier to reason about and transform
  13. 18:46Similarly, via reduce (foldl) • returning eager, appendy vectors
  14. 21:42Transducers • modify a process by transforming its reducing function
  15. 23:42reduce-based map et al redux (defn nopl f coll)
  16. 25:30Backwards comp?
  17. 27:15Transducers are Fast
  18. 27:57Transducer Types, Thus Far
  19. 30:14Early Termination • Reduction normally processes all input . Sometimes a process has just had enough input, or gotten external trigger to terminate
  20. 32:25Transducers Support reduced
  21. 36:37A Stateful Transducer
  22. 37:01Completion
  23. 40:46Init
  24. 43:10Filter, returning a Transducer
  25. 43:53The Goal
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.