Hacker News new | ask | show | jobs
by unrealhoang 5 days ago
isn't this https://clojure.org/reference/transducers?
2 comments

Continuations predate transducers by some ~40 years and are mostly used as a means of control flow, but yes they are very similar.

Transducers are specialized to data transformation pipelines, continuations are a form of control flow from which you can derive a lot of cool things (exceptions, time travel debugging etc).

Thank you! This is the concept I've been looking for. I always had the sense that compositional data transformation frameworks like PRQL or LINQ should have a clean categorical interpretation. I was exploring how this could be expressed in terms of monads but they usually start with the data while I was trying to formalise the composition of the transformations. I think transducers are it.

Transducers are just the morphisms in the category of the reducing-functions. No problem!