Shortcut Fusion of Monadic Programs

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.

[1]  Philip Wadler,et al.  Theorems for free! , 1989, FPCA.

[2]  Akihiko Takano,et al.  Shortcut deforestation in calculational form , 1995, FPCA '95.

[3]  Simon L. Peyton Jones,et al.  A short cut to deforestation , 1993, FPCA '93.

[4]  Roland Carl Backhouse,et al.  Algebraic and Coalgebraic Methods in the Mathematics of Program Construction , 2000, Lecture Notes in Computer Science.

[5]  Jeremy Gibbons,et al.  Calculating Functional Programs , 2000, Algebraic and Coalgebraic Methods in the Mathematics of Program Construction.

[6]  Graham Hutton,et al.  Monadic parsing in Haskell , 1998, Journal of Functional Programming.

[7]  Richard S. Bird,et al.  Introduction to functional programming using haskeu , 1998 .

[8]  VoigtländerJanis,et al.  Free theorems in the presence of seq , 2004 .

[9]  Neil Ghani,et al.  Short Cut Fusion of Recursive Programs with Computational Effects , 2008 .

[10]  Andrew John Gill,et al.  Cheap deforestation for non-strict functional languages , 1996 .

[11]  Alberto Pardo,et al.  Fusion of recursive programs with computational effects , 2001, Theor. Comput. Sci..

[12]  Olaf Chitil,et al.  Type-inference based deforestation of functional programs , 2000 .

[13]  Tarmo Uustalu,et al.  Monadic augment and generalised short cut fusion , 2005, ICFP '05.

[14]  R. Bird Introduction to functional programming using Haskell, Second Edition , 1998 .

[15]  Patricia Johann,et al.  Short Cut Fusion for Effects , 2008, Trends in Functional Programming.

[16]  Patricia Johann,et al.  Free theorems in the presence of seq , 2004, POPL.

[17]  Alberto Pardo Combining Datatypes and Effects , 2004, Advanced Functional Programming.

[18]  Johan Jeuring,et al.  Merging Monads and Folds for Functional Programming , 1995, Advanced Functional Programming.

[19]  Samson Abramsky,et al.  Handbook of logic in computer science. , 1992 .

[20]  Philip Wadler,et al.  Monads for functional programming , 1995, NATO ASI PDC.

[21]  Samson Abramsky,et al.  Domain theory , 1995, LICS 1995.