# ANN: Transducers.jl, efficient and composable algorithms for map- and reduce-like operations

**URL:** https://discourse.julialang.org/t/ann-transducers-jl-efficient-and-composable-algorithms-for-map-and-reduce-like-operations/19159
**Category:** Package Announcements
**Created:** [January 1, 2019, 3:30am UTC](https://discourse.julialang.org/t/ann-transducers-jl-efficient-and-composable-algorithms-for-map-and-reduce-like-operations/19159 "2019-01-01T03:30:43Z")
**Posts on this page:** 1
**Showing post:** 19

<div class="post-metadata">

### Author: ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)
#### Post date: [January 18, 2019, 2:09am UTC](https://discourse.julialang.org/t/ann-transducers-jl-efficient-and-composable-algorithms-for-map-and-reduce-like-operations/19159/19 "2019-01-18T02:09:02Z")

</div>

Another thought: I think the best “feature” of transducers for performance-oriented language like Julia is actually not transducers themselves but rather the _`foldl` implementations specialized for container types_. I guess that’s not news since Julia `Base` has very efficient `foldl`/`mapfoldl`. However, `foldl` (or `mapfoldl`) itself is not really composable — that’s where transducers come in. Transducers are composable “pre-processors” of the “reducing function” `op` you passed to `foldl`. I think one of the great observations by Rich Hickey is that this set of pre-processors can be as powerful as the usual iterator tool chain. But, as @arghhhh pointed out, it requires a generalization of `foldl` for supporting early termination and completion. I think it is worth doing so since it can be compiled away if you don’t use it.

---

_[View the full topic](https://discourse.julialang.org/t/ann-transducers-jl-efficient-and-composable-algorithms-for-map-and-reduce-like-operations/19159)._
