Results

**11 - 12**of**12**### Towards Merging Recursion and Comonads

, 2000

"... Comonads are mathematical structures that account naturally for effects that derive from the context in which a program is executed. This paper reports ongoing work on the interaction between recursion and comonads. Two applications are shown that naturally lead to versions of a comonadic fold op ..."

Abstract
- Add to MetaCart

Comonads are mathematical structures that account naturally for effects that derive from the context in which a program is executed. This paper reports ongoing work on the interaction between recursion and comonads. Two applications are shown that naturally lead to versions of a comonadic fold operator on the product comonad. Both versions capture functions that require extra arguments for their computation and are related with the notion of strong datatype. 1 Introduction One of the main features of recursive operators derivable from datatype definitions is that they impose a structure upon programs which can be exploited for program transformation. Recursive operators structure functional programs according to the data structures they traverse or generate and come equipped with a battery of algebraic laws, also derivable from type definitions, which are used in program calculations [24, 11, 5, 15]. Some of these laws, the so-called fusion laws, are particularly interesting in p...

### On Deforesting Parameters of Accumulating Maps (Extended Abstract)

, 2001

"... Deforestation is a well-known program transformation technique which eliminates intermediate data structures that are passed between functions. One of its weaknesses is the inability to deforest programs using accumulating parameters. We show how intermediate lists built by a selected class of funct ..."

Abstract
- Add to MetaCart

Deforestation is a well-known program transformation technique which eliminates intermediate data structures that are passed between functions. One of its weaknesses is the inability to deforest programs using accumulating parameters. We show how intermediate lists built by a selected class of functional programs, namely `accumulating maps', can be deforested using a single composition rule. For this we introduce a new function dmap, a symmetric extension of the familiar function map. While the associated composition rule cannot capture all deforestation problems, it can handle accumulator fusion of functions de ned in terms of dmap in a surprisingly simple way. The rule for accumulator fusion presented here can also be viewed as a restricted composition scheme for attribute grammars, which in turn may help us to bridge the gap between the attribute and functional world.