Another Word For It Patrick Durusau on Topic Maps and Semantic Diversity

August 6, 2014

Transducers Are Coming

Filed under: Clojure,Functional Programming — Patrick Durusau @ 1:47 pm

Transducers Are Coming by Rich Hickey.

From the post:

Transducers are a powerful and composable way to build algorithmic transformations that you can reuse in many contexts, and they’re coming to Clojure core and core.async.

Two years ago, in a blog post describing how reducers work, I described the reducing function transformers on which they were based, and provided explicit examples like ‘mapping‘, ‘filtering‘ and ‘mapcatting‘. Because the reducers library intends to deliver an API with the same ‘shape’ as existing sequence function APIs, these transformers were never exposed a la carte, instead being encapsulated by the macrology of reducers.

In working recently on providing algorithmic combinators for core.async, I became more and more convinced of the superiority of reducing function transformers over channel->channel functions for algorithmic transformation. In fact, I think they are a better way to do many things for which we normally create bespoke replicas of map, filter etc.

So, reducing function transformers are getting a name – ‘transducers‘, and first-class support in Clojure core and core.async.

A glimpse of ongoing work on Clojure.

Would not be too late to start reading about transducers now.

I first saw this in a tweet by Cognitect, Inc.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress