Results 1 
2 of
2
Merging Monads and Folds for Functional Programming
 In Advanced Functional Programming, LNCS 925
, 1995
"... . These notes discuss the simultaneous use of generalised fold operators and monads to structure functional programs. Generalised fold operators structure programs after the decomposition of the value they consume. Monads structure programs after the computation of the value they produce. Our progra ..."
Abstract

Cited by 49 (2 self)
 Add to MetaCart
. These notes discuss the simultaneous use of generalised fold operators and monads to structure functional programs. Generalised fold operators structure programs after the decomposition of the value they consume. Monads structure programs after the computation of the value they produce. Our programs abstract both from the recursive processing of their input as well as from the sideeffects in computing their output. We show how generalised monadic folds aid in calculating an efficient graph reduction engine from an inefficient specification. 1 Introduction Should I structure my program after the decomposition of the value it consumes or after the computation of the value it produces? Some [Bir89, Mee86, Mal90, Jeu90, MFP91] argue in favour of structuring programs after the decomposition of the value they consume. Such syntax directed programs are written using a limited set of recursion functionals. These functionals, called catamorphisms or generalised fold operators are naturally ...
Constructing Functional Programs for Grammar Analysis Problems
 In Conference Record of FPCA '95, SIGPLANSIGARCHWG2.8 Conference on Functional Programming Languages and Computer Architecture
, 1995
"... This paper discusses the derivation of functional programs for grammar analysis problems, such as the Empty problem and the Reachable problem. Grammar analysis problems can be divided into two classes: topdown problems such as Follow and Reachable, which are described in terms of the contexts of n ..."
Abstract

Cited by 7 (3 self)
 Add to MetaCart
This paper discusses the derivation of functional programs for grammar analysis problems, such as the Empty problem and the Reachable problem. Grammar analysis problems can be divided into two classes: topdown problems such as Follow and Reachable, which are described in terms of the contexts of nonterminals, and bottomup problems such as Empty and First, which do not refer to contexts. In a previous paper we derive a program for bottomup grammar analysis problems. In this paper we derive a program for topdown grammar analysis problems by transforming the specification of an arbitrary topdown problem into a program. The existence of a solution is guaranteed provided some natural conditions are satisfied. Furthermore, we describe a general transformation that applies to both classes of grammar analysis problems. The result of this transformation is a program that avoids unnecessary computations in the computation of a fixed point. Constructor classes, which are used to abstract fr...