4 ms·
Transducers are not loops. You can create transducers and pass them as arguments to functions, that in their turn can prepend or append then. They are composab
by bjoli 2y ago
Transducers are not loops. You can create transducers and pass them as arguments to functions, that in their turn can prepend or append then.
They are composable algorithmic transformations.
- drcode 2y agocomposable algorithmic transformation in the streets but mostly an alternative to LOOP in the sheets
- bjoli 2y agoSure. But in that case it is somewhere between map(car)-and-friends and LOOP. Which is a situation where they add very little. Being able to use them as an intermediate step wherever data flows is probably the only place I use them myself. In channels, in file-readers etc. in places where you really need speed you should of course reach for whatever loop construct you prefer.
- RhysU 2y ago> composable algorithmic transformations This phrasing always feels pointlessly fancy. I may be understeeped in the right lore. What is a non-composable, non-algorithmic transformation? A composable, non-algorithmic transformation? A non-composable, algorithmic transformation? Maybe there's some constraint on the domain vs the range buried in "transformation"?
- bjoli 2y agoThere are lots of examples of non-composable transformations. Two functions are not necessarily composable. Call/cc does not compose with the current continuation, whereas delimited continuations do. Algorithmic transformations are algorithmic. The result is well-defined. It is a succinct way of saying that a transducer is a well-defined (in terms of input and output) transformation that can be combined with other transducers. I didn't make up the lingo.
- deleted 2y ago[deleted]