Results 1  10
of
43
Bananas in Space: Extending Fold and Unfold to Exponential Types
, 1995
"... Fold and unfold are general purpose functionals for processing and constructing lists. By using the categorical approach of modelling recursive datatypes as fixed points of functors, these functionals and their algebraic properties were generalised from lists to polynomial (sumofproduct) datatypes ..."
Abstract

Cited by 95 (6 self)
 Add to MetaCart
Fold and unfold are general purpose functionals for processing and constructing lists. By using the categorical approach of modelling recursive datatypes as fixed points of functors, these functionals and their algebraic properties were generalised from lists to polynomial (sumofproduct) datatypes. However, the restriction to polynomial datatypes is a serious limitation: it precludes the use of exponentials (functionspaces) , whereas it is central to functional programming that functions are firstclass values, and so exponentials should be able to be used freely in datatype definitions. In this paper we explain how Freyd's work on modelling recursive datatypes as fixed points of difunctors shows how to generalise fold and unfold from polynomial datatypes to those involving exponentials. Knowledge of category theory is not required; we use Gofer throughout as our metalanguage, making extensive use of constructor classes. 1 Introduction During the 1980s, Bird and Meertens [6, 22] d...
Shortcut Deforestation in Calculational Form
 In Proc. Conference on Functional Programming Languages and Computer Architecture
, 1995
"... In functional programming, intermediate data structures are often used to "glue" together small programs. Deforestation is a program transformation to remove these intermediate data structures automatically. We present a simple algorithm for deforestation based on two fusion rules for hylo ..."
Abstract

Cited by 91 (3 self)
 Add to MetaCart
In functional programming, intermediate data structures are often used to "glue" together small programs. Deforestation is a program transformation to remove these intermediate data structures automatically. We present a simple algorithm for deforestation based on two fusion rules for hylomorphism, an expressive recursion pattern. A generic notation for hylomorphisms is introduced, where natural transformations are explicitly factored out, and it is used to represent programs. Our method successfully eliminates intermediate data structures of any algebraic type from a much larger class of compositional functional programs than previous techniques. 1 Introduction In functional programming, programs are often constructed by "gluing" together small components, using intermediate data structures to convey information between them. Such data are constructed in one component and later consumed in another component, but never appear in the result of the whole program. The compositional styl...
Google’s MapReduce Programming Model — Revisited
"... Google’s MapReduce programming model serves for processing large data sets in a massively parallel manner. We deliver the first rigorous description of the model including its advancement as Google’s domainspecific language Sawzall. To this end, we reverseengineer the seminal papers on MapReduce a ..."
Abstract

Cited by 43 (1 self)
 Add to MetaCart
Google’s MapReduce programming model serves for processing large data sets in a massively parallel manner. We deliver the first rigorous description of the model including its advancement as Google’s domainspecific language Sawzall. To this end, we reverseengineer the seminal papers on MapReduce and Sawzall, and we capture our findings as an executable specification. We also identify and resolve some obscurities in the informal presentation given in the seminal papers. We use typed functional programming (specifically Haskell) as a tool for design recovery and executable specification. Our development comprises three components: (i) the basic program skeleton that underlies MapReduce computations; (ii) the opportunities for parallelism in executing MapReduce computations; (iii) the fundamental characteristics of Sawzall’s aggregators as an advancement of the MapReduce approach. Our development does not formalize the more implementational aspects of an actual, distributed execution of MapReduce computations.
Sorting Morphisms
 3rd International Summer School on Advanced Functional Programming, volume 1608 of LNCS
, 1998
"... . Sorting algorithms can be classified in many different ways. The way presented here is by expressing the algorithms as functional programs and to classify them by means of their recursion patterns. These patterns on their turn can be classified as the natural recursion patterns that destruct or co ..."
Abstract

Cited by 28 (0 self)
 Add to MetaCart
. Sorting algorithms can be classified in many different ways. The way presented here is by expressing the algorithms as functional programs and to classify them by means of their recursion patterns. These patterns on their turn can be classified as the natural recursion patterns that destruct or construct a given datatype, the so called cata and anamorphisms respectively. We show that the selection of the recursion pattern can be seen as the major design decision, in most cases leaving no more room for more decisions in the design of the sorting algorithm. It is also shown that the use of alternative data structures may lead to new sorting algorithms. This presentation also serves as a gentle, lightweight, introduction into the various morphisms. 1 Introduction In this paper we present several well known sorting algorithms, namely insertion sort, straight selection sort, bubble sort, quick sort, heap sort and merge sort (see e.g. [Knu73, Wir76]) in a nonstandard way. We express...
Deriving Backtracking Monad Transformers
 In The International Conference on Functional Programming (ICFP
, 2000
"... In a paper about pretty printing J. Hughes introduced two fundamental techniques for deriving programs from their specication, where a specication consists of a signature and properties that the operations of the signature are required to satisfy. Briey, the rst technique, the term implementation, r ..."
Abstract

Cited by 27 (1 self)
 Add to MetaCart
In a paper about pretty printing J. Hughes introduced two fundamental techniques for deriving programs from their specication, where a specication consists of a signature and properties that the operations of the signature are required to satisfy. Briey, the rst technique, the term implementation, represents the operations by terms and works by dening a mapping from operations to observations  this mapping can be seen as dening a simple interpreter. The second, the contextpassing implementation, represents operations as functions from their calling context to observations. We apply both techniques to derive a backtracking monad transformer that adds backtracking to an arbitrary monad. In addition to the usual backtracking operations  failure and nondeterministic choice  the prolog cut and an operation for delimiting the eect of a cut are supported. Categories and Subject Descriptors D.1.1 [Programming Techniques]: Applicative (Functional) Programming; D.3.2 [Programming La...
Fold and Unfold for Program Semantics
 In Proc. 3rd ACM SIGPLAN International Conference on Functional Programming
, 1998
"... In this paper we explain how recursion operators can be used to structure and reason about program semantics within a functional language. In particular, we show how the recursion operator fold can be used to structure denotational semantics, how the dual recursion operator unfold can be used to str ..."
Abstract

Cited by 23 (4 self)
 Add to MetaCart
In this paper we explain how recursion operators can be used to structure and reason about program semantics within a functional language. In particular, we show how the recursion operator fold can be used to structure denotational semantics, how the dual recursion operator unfold can be used to structure operational semantics, and how algebraic properties of these operators can be used to reason about program semantics. The techniques are explained with the aid of two main examples, the first concerning arithmetic expressions, and the second concerning Milner's concurrent language CCS. The aim of the paper is to give functional programmers new insights into recursion operators, program semantics, and the relationships between them. 1 Introduction Many computations are naturally expressed as recursive programs defined in terms of themselves, and properties proved of such programs using some form of inductive argument. Not surprisingly, many programs will have a similar recursive stru...
Polytypic compact printing and parsing
 In Doaitse Swierstra, editor, ESOP’99, volume 1576 of LNCS
, 1999
"... Abstract. A generic compact printer and a corresponding parser are constructed. These programs transform values of any regular datatype to and from a bit stream. The algorithms are constructed along with a proof that printing followed by parsing is the identity. Since the binary representation is ve ..."
Abstract

Cited by 22 (7 self)
 Add to MetaCart
Abstract. A generic compact printer and a corresponding parser are constructed. These programs transform values of any regular datatype to and from a bit stream. The algorithms are constructed along with a proof that printing followed by parsing is the identity. Since the binary representation is very compact, the printer can be used for compressing data possibly supplemented with some standard algorithm for compressing bit streams. The compact printer and the parser are described in the polytypic Haskell extension PolyP. 1
Compiling Exceptions Correctly
 In Proceedings of the 7th International Conference on Mathematics of Program Construction
, 2004
"... Exceptions are an important feature of modern programming languages, but their compilation has traditionally been viewed as an advanced topic. In this article we show that the basic method of compiling exceptions using stack unwinding can be explained and verified both simply and precisely, usin ..."
Abstract

Cited by 16 (6 self)
 Add to MetaCart
Exceptions are an important feature of modern programming languages, but their compilation has traditionally been viewed as an advanced topic. In this article we show that the basic method of compiling exceptions using stack unwinding can be explained and verified both simply and precisely, using elementary functional programming techniques.
Calculating Accumulations
, 1999
"... this paper, we shall formulate accumulations as higher order catamorphisms , and propose several general transformation rules for calculating accumulations (i.e., finding and manipulating accumulations) by calculationbased (rather than a searchbased) program transformation methods. Some examples ..."
Abstract

Cited by 16 (6 self)
 Add to MetaCart
this paper, we shall formulate accumulations as higher order catamorphisms , and propose several general transformation rules for calculating accumulations (i.e., finding and manipulating accumulations) by calculationbased (rather than a searchbased) program transformation methods. Some examples are given for illustration.