Recursion schemes from comonads
Nordic Journal of Computing
Proceedings of the tenth ACM SIGPLAN international conference on Functional programming
Recursive coalgebras from comonads
Information and Computation - Special issue: Seventh workshop on coalgebraic methods in computer science 2004
Pearls of Functional Algorithm Design
Pearls of Functional Algorithm Design
IFL'10 Proceedings of the 22nd international conference on Implementation and application of functional languages
Recursion schemes for dynamic programming
MPC'06 Proceedings of the 8th international conference on Mathematics of Program Construction
Unifying structured recursion schemes
Proceedings of the 18th ACM SIGPLAN international conference on Functional programming
Adjoint folds and unfolds-An extended study
Science of Computer Programming
Hi-index | 0.00 |
Dynamic programming algorithms embody a widely used programming technique that optimizes recursively defined equations that have repeating subproblems. The standard solution uses arrays to share common results between successive steps, and while effective, this fails to exploit the structural properties present in these problems. Histomorphisms and dynamorphisms have been introduced to expresses such algorithms in terms of structured recursion schemes that leverage this structure. In this paper, we revisit and relate these schemes and show how they can be expressed in terms of recursion schemes from comonads, as well as from recursive coalgebras. Our constructions rely on properties of bialgebras and dicoalgebras, and we are careful to consider optimizations and efficiency concerns. Throughout the paper we illustrate these techniques through several worked-out examples discussed in a tutorial style, and show how a recursive specification can be expressed both as an array-based algorithm as well as one that uses recursion schemes.