Results 1  10
of
21
Generic programming: An introduction
 3rd International Summer School on Advanced Functional Programming
, 1999
"... ..."
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 ...
Calculate Polytypically!
 In PLILP'96, volume 1140 of LNCS
, 1996
"... A polytypic function definition is a function definition that is parametrised with a datatype. It embraces a class of algorithms. As an example we define a simple polytypic "crush" combinator that can be used to calculate polytypically. The ability to define functions polytypically adds another leve ..."
Abstract

Cited by 41 (3 self)
 Add to MetaCart
A polytypic function definition is a function definition that is parametrised with a datatype. It embraces a class of algorithms. As an example we define a simple polytypic "crush" combinator that can be used to calculate polytypically. The ability to define functions polytypically adds another level of flexibility in the reusability of programming idioms and in the design of libraries of interoperable components.
Dealing with Large Bananas
 Universiteit Utrecht
, 2000
"... Abstract. Many problems call for a mixture of generic and speci c programming techniques. We propose a polytypic programming approach based on generalised (monadic) folds where a separation is made between basic fold algebras that model generic behaviour and updates on these algebras that model spec ..."
Abstract

Cited by 29 (12 self)
 Add to MetaCart
Abstract. Many problems call for a mixture of generic and speci c programming techniques. We propose a polytypic programming approach based on generalised (monadic) folds where a separation is made between basic fold algebras that model generic behaviour and updates on these algebras that model speci c behaviour. We identify particular basic algebras as well as some algebra combinators, and we show how these facilitate structured programming with updatable fold algebras. This blend of genericity and speci city allows programming with folds to scale up to applications involving large systems of mutually recursive datatypes. Finally, we address the possibility of providing generic de nitions for the functions, algebras, and combinators that we propose. 1
Recursion Schemes from Comonads
, 2001
"... . Within the setting of the categorical approach to programming with total functions, a \manyinone" recursion scheme is introduced that neatly unies a variety of recursion schemes looking as diverging generalizations of the basic recursion scheme of iteration. The scheme is doubly generic: in addi ..."
Abstract

Cited by 21 (4 self)
 Add to MetaCart
. Within the setting of the categorical approach to programming with total functions, a \manyinone" recursion scheme is introduced that neatly unies a variety of recursion schemes looking as diverging generalizations of the basic recursion scheme of iteration. The scheme is doubly generic: in addition to behaving uniformly with respect to a functor determining an inductive type, it is also uniform in a comonad and a distributive law which together determine a particular recursion scheme for this inductive type. By way of examples, it is shown to subsume iteration, a scheme subsuming primitive recursion, and a scheme subsuming courseofvalue iteration.
The essence of the Iterator pattern
 McBride, Conor, & Uustalu, Tarmo (eds), Mathematicallystructured functional programming
, 2006
"... The ITERATOR pattern gives a clean interface for elementbyelement access to a collection. Imperative iterations using the pattern have two simultaneous aspects: mapping and accumulating. Various existing functional iterations model one or other of these, but not both simultaneously. We argue that ..."
Abstract

Cited by 17 (8 self)
 Add to MetaCart
The ITERATOR pattern gives a clean interface for elementbyelement access to a collection. Imperative iterations using the pattern have two simultaneous aspects: mapping and accumulating. Various existing functional iterations model one or other of these, but not both simultaneously. We argue that McBride and Patersonâ€™s idioms, and in particular the corresponding traverse operator, do exactly this, and therefore capture the essence of the ITERATOR pattern. We present some axioms for traversal, and illustrate with a simple example, the repmin problem.
Transposing relations: from Maybe functions to hash tables
 In MPCâ€™04, volume 3125 of LNCS
, 2004
"... Abstract. Functional transposition is a technique for converting relations into functions aimed at developing the relational algebra via the algebra of functions. This paper attempts to develop a basis for generic transposition. Two instances of this construction are considered, one applicable to an ..."
Abstract

Cited by 15 (11 self)
 Add to MetaCart
Abstract. Functional transposition is a technique for converting relations into functions aimed at developing the relational algebra via the algebra of functions. This paper attempts to develop a basis for generic transposition. Two instances of this construction are considered, one applicable to any relation and the other applicable to simple relations only. Our illustration of the usefulness of the generic transpose takes advantage of the free theorem of a polymorphic function. We show how to derive laws of relational combinators as free theorems of their transposes. Finally, we relate the topic of functional transposition with the hashing technique for efficient data representation. 1
Fusion of Recursive Programs with Computational Effects
 Theor. Comp. Sci
, 2000
"... Fusion laws permit to eliminate various of the intermediate data structures that are created in function compositions. The fusion laws associated with the traditional recursive operators on datatypes cannot in general be used to transform recursive programs with effects. Motivated by this fact, t ..."
Abstract

Cited by 14 (4 self)
 Add to MetaCart
Fusion laws permit to eliminate various of the intermediate data structures that are created in function compositions. The fusion laws associated with the traditional recursive operators on datatypes cannot in general be used to transform recursive programs with effects. Motivated by this fact, this paper addresses the definition of two recursive operators on datatypes that capture functional programs with effects. Effects are assumed to be modeled by monads. The main goal is thus the derivation of fusion laws for the new operators. One of the new operators is called monadic unfold. It captures programs (with effects) that generate a data structure in a standard way. The other operator is called monadic hylomorphism, and corresponds to programs formed by the composition of a monadic unfold followed by a function defined by structural induction on the data structure that the monadic unfold generates. 1 Introduction A common approach to program design in functional programmin...
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

Cited by 9 (2 self)
 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 socalled fusion laws, are particularly interesting in p...