JUCS - Journal of Universal Computer Science 14(21): 3431-3446, doi: 10.3217/jucs-014-21-3431
Shortcut Fusion of Monadic Programs
expand article infoCecilia Manzino, Alberto Pardo§
‡ Universidad Nacional de Rosario, Rosario, Argentina§ Universidad de la República, Montevideo, Uruguay
Open Access
Abstract
Functional programs often combine separate parts of the program using intermediate data structures for communicating results. Programs so defined are easier to understand and maintain, but suffer from inefficiency problems due to the generation of those data structures. In response to this problematic, some program transformation techniques have been studied with the aim to eliminate the intermediate data structures that arise in function compositions. One of these techniques is known as shortcut fusion. This technique has usually been studied in the context of purely functional programs. In this work we propose an extension of shortcut fusion that is able to eliminate intermediate data structures generated in the presence of monadic effects. The extension to be presented can be uniformly defined for a wide class of data types and monads.
Keywords
shortcut fusion, monads, computational effects, functional programming