Course
Understanding Transducers Through Python

Transducers – a portmanteau of “transform reducers” – are a functional programming concept introduced into the Clojure programming language. Although transducers are actually pretty straightforward in retrospect, wrapping your brain around them, especially if you're not already a competent Clojureist, can be challenging.

We introduce transducers by implementing them from scratch in Python. We’ll start with the familiar staples of functional programming, map(), filter() and reduce(), and derive transducers from first principles. We’ll work towards a set of general tools which work with eager collections, lazy “pull” sequences, and “push” event streams. Along the way we’ll cover stateful transducers and transducer composition, demonstrating that transducers are both more general, and more fundamental, than the functional programming tools baked into Python and many other languages.

On completion, not only should transducers make sense to you, but you’ll have a recipe for implementing transducers in your own favourite programming language.

46m 54s
5 modules
Intermediate
Sixty North
20% published
Free!
1
First Principles
46m 54s
11 sections
1
2
3
4
5
6
7
8
9
10
11
2
Improving Transducer Composition
0s
0 sections
3
A Transducer Protocol
0s
0 sections
4
Lazy Pull Transducers
0s
0 sections
5
Event Push Transducers
0s
0 sections