3 ms·
You can do this with recursion schemes: Haskell: https://hackage.haskell.org/package/recursion-schemes https://hackage.haskell.org/package/recursion-schemes S
by consilient 4y ago
You can do this with recursion schemes:
Haskell: https://hackage.haskell.org/package/recursion-schemes https://hackage.haskell.org/package/recursion-schemes
Scala: https://github.com/precog/matryoshka https://github.com/precog/matryoshka
- auggierose 4y agoYes, algebraising your control flow to become independent of implementation details like that is a possibility. Of course, you need a language that makes that a) easy, b) performant.
- atennapel 4y agoWhich recursion scheme guarantees tail-recursion?
- consilient 4y ago`cata` with a cps'd argument