Extending Higher-Order Deforestation: Transforming Programs to Eliminate Even More Trees

Geoff W. Hamilton · 2001

In previous work, we have shown howWadler’s original deforestation algorithm can be extended to handle higher-order programs. A higher-order treeless form of expression was defined to ensure the termination of this algorithm. Our higher-order algorithm was further extended by Seidl and Sorensen, and this extension was shown to remove some intermediate structures not removed by our algorithm (although our algorithm can also remove some intermediate structures not removed by their technique). In this paper, we show how our original algorithm can be further extended to remove the intermediate structures in the examples given by Seidl and Sorensen. We argue that, because our extended algorithm uses an easy to recognise treeless form, there is more transparency for the programmer in terms of the improvements which will be made. Also, unlike the algorithm of Seidl and Sorensen, our extended algorithm is guaranteed to result in no loss of efficiency. We argue that this is essential for any optimisation.

Read the paper · More papers on PaperTik