logoalt Hacker News

unrealhoangtoday at 5:32 AM2 repliesview on HN

isn't this https://clojure.org/reference/transducers?


Replies

snthpytoday at 4:05 PM

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!

fredrikholmtoday at 7:00 AM

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).