Fusion of recursive programs with computational effects

Alberto Pardo
2001 Theoretical Computer Science  
Fusion laws permit to eliminate various of the intermediate data structures that are created in function compositions. The fusion laws associated with the traditional recursive operators on datatypes cannot, in general, be used to transform recursive programs with e ects. Motivated by this fact, this paper addresses the deÿnition of two recursive operators on datatypes that capture functional programs with e ects. E ects are assumed to be modeled by monads. The main goal is thus the derivation
more » ... f fusion laws for the new operators. One of the new operators is called monadic unfold. It captures programs (with e ects) that generate a data structure in a standard way. The other operator is called monadic hylomorphism, and corresponds to programs formed by the composition of a monadic unfold followed by a function deÿned by structural induction on the data structure that the monadic unfold generates.
doi:10.1016/s0304-3975(00)00127-4 fatcat:s6rzj6rdqngdtfc462ytmemtpe