3 ms·
I played with these kinds of reductions in a subset of scheme, and the flow analysis you need to do to be able to do it safely is nontrivial at best depending o
by bjoli 6y ago
I played with these kinds of reductions in a subset of scheme, and the flow analysis you need to do to be able to do it safely is nontrivial at best depending on how you limit the semantics of your language.
It was a lot easier to do with something like srfi-171 [0] due to their semantics. Fusing those steps is as simple as inlining.
[0] transducers, like in clojure. https://srfi.schemers.org/srfi-171/srfi-171.html https://srfi.schemers.org/srfi-171/srfi-171.html . I am the srfi author.
- siraben 6y agoThat interesting. Reminds me of Haskell's Foldable[0] and Functor typeclasses, which abstracts over containers as well. [0] https://hackage.haskell.org/package/base-4.14.0.0/docs/Data-Foldable.html https://hackage.haskell.org/package/base-4.14.0.0/docs/Data-...