Transducers are *reducing function transformers*. They take a reducing 
function and return another reducing function with some new actions. E.g.

(let [xf ((comp (map inc) (filter even?)))]
  (reduce (xf +) 0 [1 2 3]))

Here, `xf` is the transducer. It takes the reducing function `+` as an 
argument and returns another reducing function that incorporates the `(map 
inc)` and the `(filter even?)` into the `+`. There are some fine details 
about order of composition, but that's the gist of it.

What transducers do is capture the entire logic of *what* to do, while the 
collection (*reducible*) handles *how* to do it (by implementing one of the 
reduce-related interfaces, e.g. `CollReduce`). This is a useful 
decomplection of concerns.

Coincidentally, I was just preparing a presentation on 
reducers/transducers, so here's a big 'ol list of references on transducers:


   - 
   
   Transducers are Coming 
   <http://blog.cognitect.com/blog/2014/8/6/transducers-are-coming>
   - 
      
      Transducers (Video) <https://www.youtube.com/watch?v=6mTbuzafcII>
      - 
      
      Inside Transducers (Video) 
      <https://www.youtube.com/watch?v=4KqUvG8HPYo>
      - 
   
   Rich Hickey explaining transducers--in Haskell 
   
<https://www.reddit.com/r/haskell/comments/2cv6l4/clojures_transducers_are_perverse_lenses/cjjyay7/>
   - 
   
   Building ETL pipelines with Clojure and transducers 
   <https://tech.grammarly.com/blog/building-etl-pipelines-with-clojure>
   

On Friday, May 12, 2017 at 5:47:19 PM UTC-7, tbc++ wrote:
>
> Sure, you can contact me at the address used in this reply :)
>
> Timothy Baldridge
>
> On Fri, May 12, 2017 at 11:19 AM, Erlis Vidal <er...@erlisvidal.com 
> <javascript:>> wrote:
>
>> Is there a way I can contact Tim Baldridge for questions about the 
>> subscription? 
>>
>> Thanks!
>>
>> On Sun, Jan 31, 2016 at 12:40 PM, Mars0i <mars...@logical.net 
>> <javascript:>> wrote:
>>
>>> Thanks jjttjj, Magomimmo.  I do prefer reading to videos, but I'll 
>>> consider getting Baldridge's series anyway.  Seems worth it.  I don't mind 
>>> paying.
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@googlegroups.com 
>>> <javascript:>
>>> Note that posts from new members are moderated - please be patient with 
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+u...@googlegroups.com <javascript:>
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to clojure+u...@googlegroups.com <javascript:>.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> <javascript:>
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> “One of the main causes of the fall of the Roman Empire was that–lacking 
> zero–they had no way to indicate successful termination of their C 
> programs.”
> (Robert Firth) 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to