Sciweavers

ICFP
1999
ACM

Type Inference Builds a Short Cut to Deforestation

14 years 4 months ago
Type Inference Builds a Short Cut to Deforestation
Deforestation optimises a functional program by transforming it into another one that does not create certain intermediate data structures. Short cut deforestation is a deforestation method which is based on a single, local transformation rule. In return, short cut deforestation expects both producer and consumer of the intermediate structure in a certain form. Warm fusion was proposed to automatically transform functions into this form. Unfortunately, it is costly and hard to implement. Starting from the fact that short cut deforestation is based on a parametricity theorem of the second-order typed λ-calculus, we show how the required form of a list producer can be derived through the use of type inference. Typability for the second-order typed λ-calculus is undecidable. However, we present a linear-time algorithm that solves a partial type inference problem and that, together with controlled inlining and polymorphic type instantiation, suffices for deforestation. The resulting new...
Olaf Chitil
Added 02 Aug 2010
Updated 02 Aug 2010
Type Conference
Year 1999
Where ICFP
Authors Olaf Chitil
Comments (0)