Multiple intermediate structure deforestation by shortcut fusion

Shortcut fusion is a well-known optimization technique for functional programs. Its aim is to transform multi-pass algorithms into single pass ones, achieving deforestation of the intermediate structures that multi-pass algorithms need to construct. Shortcut fusion has already been extended in several ways. It can be applied to monadic programs, maintaining the global effects, and also to obtain circular and higher-order programs. The techniques proposed so far, however, only consider programs defined as the composition of a single producer with a single consumer. In this paper, we analyse shortcut fusion laws to deal with programs consisting of an arbitrary number of function compositions.

[1]  João Saraiva,et al.  Strictification of circular programs , 2011, PEPM '11.

[2]  S. Doaitse Swierstra,et al.  Linear, bounded, functional pretty-printing , 2009, J. Funct. Program..

[3]  Chris Okasaki,et al.  Breadth-first numbering: lessons from a small exercise in algorithm design , 2000, ICFP '00.

[4]  Thomas Johnsson,et al.  Attribute grammars as a functional programming paradigm , 1987, FPCA.

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

[6]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[7]  Alberto Pardo,et al.  Shortcut Fusion of Monadic Programs , 2008, J. Univers. Comput. Sci..

[8]  Erik Poll,et al.  Algebra of Programming by Richard Bird and Oege de Moor, Prentice Hall, 1996 (dated 1997). , 1999 .

[9]  Simon Peyton Jones,et al.  The New GHC/Hugs Runtime System , 1998 .

[10]  Richard S. Bird Using circular programs to eliminate multiple traversals of data , 2004, Acta Informatica.

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

[12]  Alberto Pardo Generic Accumulations , 2002, Generic Programming.

[13]  João Saraiva,et al.  Tools and libraries to model and manipulate circular programs , 2007, PEPM '07.

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

[15]  S. D. Swierstra,et al.  Using attribute grammars to derive efficient functional programs , 1986 .

[16]  Janis Voigtländer Semantics and Pragmatics of New Shortcut Fusion Rules , 2008, FLOPS.

[17]  Uwe Kastens,et al.  Ordered attributed grammars , 1980, Acta Informatica.

[18]  João Paulo Fernandes,et al.  Shortcut fusion rules for the derivation of circular and higher-order programs , 2011, High. Order Symb. Comput..

[19]  Ralf Hinze,et al.  Generic Haskell: practice and theory , 2003 .

[20]  John Launchbury,et al.  Warm fusion: deriving build-catas from recursive definitions , 1995, FPCA '95.

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

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

[23]  Joo Fernandes Design, Implementation and Calculation of Circular Programs: Multiple Traversal Algorithms in a Lazy Functional Setting , 2009 .

[24]  João Paulo Sousa Ferreira Fernandes Design, implementation and calculation of circular programs , 2009 .

[25]  Masato Takeichi,et al.  A calculational fusion system HYLO , 1997, Algorithmic Languages and Calculi.

[26]  S. Doaitse Swierstra,et al.  First-class Attribute Grammars , 2000, Informatica.

[27]  Lloyd Allison Circular programs and self‐referential structures , 1989, Softw. Pract. Exp..

[28]  Atze Dijkstra,et al.  Typing Haskell with an Attribute Grammar (Part I) , 2004 .

[29]  Richard S. Bird,et al.  Algebra of programming , 1997, Prentice Hall International series in computer science.

[30]  João Saraiva,et al.  Shortcut fusion rules for the derivation of circular and higher-order monadic programs , 2009, PEPM '09.

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

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

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

[34]  Donald E. Knuth,et al.  Semantics of context-free languages , 1968, Mathematical systems theory.

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

[36]  João Saraiva,et al.  A shortcut fusion rule for circular program calculation , 2007, Haskell '07.