News for hackers. Stuff that matters.
Re:Processing documents with Clojure transducers by moomin on Tuesday June 02, 2015 @01:36PM (#9647508)
I don't really like the "streaming" story. In reduction, you have to implement three arities. In streaming, only two are used. Moreover, the "reducing value" is opaque in said scenarios. All of this basically amounts to the two cases are very different. So a streaming transducer can be used in a reducing context, but not really vice versa.
Re:Processing documents with Clojure transducers by brandonbloom on Tuesday June 02, 2015 @10:53PM (#9650281)
Seems perfectly reasonable to me, since streaming implies that there is not necessarily a notion of a beginning nor an end. Reducing has stronger requirements of its operations.

I will admit that the multiple arities is a bit awkward when an interface (or two) could have done the trick. I'm not 100% sure I understand why Rich choose to do it the way he did. I suspect it was so that `comp` would work.

I probably would have just defined ITransducer or something and supplied a custom composition function, but then again, the Haskell lens package takes the same approach, preferring composition via `.` on functions instead of extending a hypothetical "Composable" or "Pipelinable" type-class upon which `comp`/`.` could be built.