Results 1 
6 of
6
Programming with bananas, lenses, envelopes and barbed wire
 In FPCA
, 1991
"... We develop a calculus for lazy functional programming based on recursion operators associated with data type definitions. For these operators we derive various algebraic laws that are useful in deriving and manipulating programs. We shall show that all example Functions in Bird and Wadler's &qu ..."
Abstract

Cited by 308 (11 self)
 Add to MetaCart
(Show Context)
We develop a calculus for lazy functional programming based on recursion operators associated with data type definitions. For these operators we derive various algebraic laws that are useful in deriving and manipulating programs. We shall show that all example Functions in Bird and Wadler's "Introduction to Functional Programming " can be expressed using these operators. 1
Programming with inductive and coinductive types
, 1992
"... Abstract We look at programming with inductive and coinductive datatypes, which are inspired theoretically by initial algebras and final coalgebras, respectively. A predicative calculus which incorporates these datatypes as primitive constructs is presented. This calculus allows reduction sequence ..."
Abstract

Cited by 7 (0 self)
 Add to MetaCart
(Show Context)
Abstract We look at programming with inductive and coinductive datatypes, which are inspired theoretically by initial algebras and final coalgebras, respectively. A predicative calculus which incorporates these datatypes as primitive constructs is presented. This calculus allows reduction sequences which are significantly more efficient for two dual classes of common programs than do previous calculi using similar primitives. Several techniques for programming in this calculus are illustrated with numerous examples. A short survey of related work is also included.
Structural Polymorphism
 Informal Proceedings Workshop on Generic Programming, WGP'98, Marstrand
, 1998
"... This paper describes structural polymorphism, a new form of type polymorphism appropriate to functional languages featuring userdefined algebraic data types (e.g., Standard ML, Haskell and Miranda 1 ). The approach extends the familiar notion of parametric polymorphism by allowing the definition of ..."
Abstract

Cited by 6 (0 self)
 Add to MetaCart
This paper describes structural polymorphism, a new form of type polymorphism appropriate to functional languages featuring userdefined algebraic data types (e.g., Standard ML, Haskell and Miranda 1 ). The approach extends the familiar notion of parametric polymorphism by allowing the definition of functions which are generic with respect to data structures as well as to individual types. For example, structural polymorphism accommodates generalizations of the usual length and map functions which may be applied not only to lists, but also to trees, binary trees or similar algebraic structures. Under traditional polymorphic type systems, these functions may be defined for arbitrary component types, but must be (laboriously) redefined for every distinct data structure. In this sense, our approach also extends the spirit of parametric polymorphism, in that it provides the programmer relief from the burden of unnecessary repetitive effort. The mechanism we will use to realize this form of polymorphism is inspired by a feature familiar to functional programmers, namely the pattern abstraction. Pattern abstractions generalize the usual lambda abstraction (x.e) in that they are comprised of multiple pattern/expression clauses, rather than just a single boundvariable/expression pair. By analogy with pattern abstractions, we generalize polymorphic type abstractions (Òå.e) to typepattern abstractions, which are comprised of multiple typepattern/expression pairs. The types given to typepattern abstractions are universally quantified, just as for traditional type abstractions, but the universal quantifiers are now justified by a recursive analysis of the forms of all possible type instantiations, rather than by parametric independence with respect to a type variable. (x:+.e) ...
Chapter 1 Coalgebras as Types determined by their Elimination Rules
"... Abstract We develop rules for coalgebras in type theory, and give meaning explanations for them. We show that elements of coalgebras are determined by their elimination rules, whereas the introduction rules can be considered as derived. This is in contrast with algebraic data types, for which the op ..."
Abstract
 Add to MetaCart
(Show Context)
Abstract We develop rules for coalgebras in type theory, and give meaning explanations for them. We show that elements of coalgebras are determined by their elimination rules, whereas the introduction rules can be considered as derived. This is in contrast with algebraic data types, for which the opposite is true: elements are determined by their introduction rules, and the elimination rules can be considered as derived. In this sense, the function type from the logical framework is more like a coalgebraic data type, the elements of which are determined by the elimination rule. We illustrate why the simplest form of guarded recursion is nothing but the introduction rule originating from the formulation of coalgebras in category theory. We discuss restrictions needed in order to preserve decidability of equality. Dedicated to Per MartinLöf on the occasion of his retirement. 1.1
Unnesting of Copatterns
"... Abstract. Inductive data such as finite lists and trees can elegantly be defined by constructors which allow programmers to analyze and manipulate finite data via pattern matching. Dually, coinductive data such as streams can be defined by observations such as head and tail and programmers can syn ..."
Abstract
 Add to MetaCart
(Show Context)
Abstract. Inductive data such as finite lists and trees can elegantly be defined by constructors which allow programmers to analyze and manipulate finite data via pattern matching. Dually, coinductive data such as streams can be defined by observations such as head and tail and programmers can synthesize infinite data via copattern matching. This leads to a symmetric language where finite and infinite data can be nested. In this paper, we compile nested pattern and copattern matching into a core language which only supports simple nonnested (co)pattern matching. This core language may serve as an intermediate language of a compiler. We show that this translation is conservative, i.e., the multistep reduction relation in both languages coincides for terms of the original language. Furthermore, we show that the translation preserves strong normalisation: a term of the original language is strongly normalising in one language if and only if it is so in the other.