Results 1 
2 of
2
Warm Fusion: Deriving BuildCatas from Recursive Definitions
 In Conf. on Func. Prog. Languages and Computer Architecture
, 1995
"... Program fusion is the process whereby separate pieces of code are fused into a single piece, typically transforming a multipass algorithm into a single pass. Recent work has made it clear that the process is especially successful if the loops or recursions are expressed using catamorphisms (e.g.fol ..."
Abstract

Cited by 72 (2 self)
 Add to MetaCart
Program fusion is the process whereby separate pieces of code are fused into a single piece, typically transforming a multipass algorithm into a single pass. Recent work has made it clear that the process is especially successful if the loops or recursions are expressed using catamorphisms (e.g.foldr) and constructorabstraction (e.g. build). In this paper we show how to transform recursive programs into this form automatically, thus enabling the fusion transformation to be applied more easily than before. 1 Introduction There are significant advantages to multipass algorithms, in which intermediate datastructures are created and traversed. In particular, each of the passes may be relatively simple, so are both easier to write and are potentially more reusable. By separating many distinct phases it becomes possible to focus on a single task, rather than attempting to do many things at the same time. The classic toy example of this is to compute the sum of the squares of the numbe...
The Calculation of a Polytypic Parser
, 1996
"... In this paper it is shown how inverses can be used to calculate a parser. A polytypic unparser is given and by using rules for calculating inverses a polytypic parser is calculated from it. It can be instantiated automatically for all data types that can be described by a regular functor. The idea t ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
In this paper it is shown how inverses can be used to calculate a parser. A polytypic unparser is given and by using rules for calculating inverses a polytypic parser is calculated from it. It can be instantiated automatically for all data types that can be described by a regular functor. The idea that a parser can be calculated as the inverse of an unparser is not new, but because polytypical functions are used here the calculated parser is very general. Inverses are defined in a general way and rules are given to calculate them. The set monad has a strong connection with inverses and for many monadic concepts the instantiation with this monad gives rise to rules about inverses. In this way the inverses of catamorphisms and anamorphisms can be characterized. As we know that the unparser and the rules that were used in the calculation are correct, the calculated parser is known to be correct too. In general the parser that results from such a calculation is not very efficient and it is possible to construct much more efficient parsers by hand. Because it is possible to prove the equality of these two parsers, this parser is correct too. An implementation of parsers for a small subset of html and latex is given as an illustration of how the polytypic functions are instantiated for a particular datatype. Contents 1