Results 1  10
of
11
Polytypic Values Possess Polykinded Types
, 2000
"... A polytypic value is one that is defined by induction on the structure of types. In Haskell the type structure is described by the socalled kind system, which distinguishes between manifest types like the type of integers and functions on types like the list type constructor. Previous approaches to ..."
Abstract

Cited by 107 (20 self)
 Add to MetaCart
A polytypic value is one that is defined by induction on the structure of types. In Haskell the type structure is described by the socalled kind system, which distinguishes between manifest types like the type of integers and functions on types like the list type constructor. Previous approaches to polytypic programming were restricted in that they only allowed to parameterize values by types of one fixed kind. In this paper we show how to define values that are indexed by types of arbitrary kinds. It appears that these polytypic values possess types that are indexed by kinds. We present several examples that demonstrate that the additional exibility is useful in practice. One paradigmatic example is the mapping function, which describes the functorial action on arrows. A single polytypic definition yields mapping functions for datatypes of arbitrary kinds including first and higherorder functors. Polytypic values enjoy polytypic properties. Using kindindexed logical relations we prove...
Universes for Generic Programs and Proofs in Dependent Type Theory
 Nordic Journal of Computing
, 2003
"... We show how to write generic programs and proofs in MartinL of type theory. To this end we consider several extensions of MartinL of's logical framework for dependent types. Each extension has a universes of codes (signatures) for inductively defined sets with generic formation, introduction, el ..."
Abstract

Cited by 42 (2 self)
 Add to MetaCart
We show how to write generic programs and proofs in MartinL of type theory. To this end we consider several extensions of MartinL of's logical framework for dependent types. Each extension has a universes of codes (signatures) for inductively defined sets with generic formation, introduction, elimination, and equality rules. These extensions are modeled on Dybjer and Setzer's finitely axiomatized theories of inductiverecursive definitions, which also have a universe of codes for sets, and generic formation, introduction, elimination, and equality rules.
Design Patterns as HigherOrder DatatypeGeneric Programs
, 2006
"... Design patterns are reusable abstractions in objectoriented software. However, using current mainstream programming languages, these elements can only be expressed extralinguistically: as prose, pictures, and prototypes. We believe that this is not inherent in the patterns themselves, but evidence ..."
Abstract

Cited by 14 (6 self)
 Add to MetaCart
Design patterns are reusable abstractions in objectoriented software. However, using current mainstream programming languages, these elements can only be expressed extralinguistically: as prose, pictures, and prototypes. We believe that this is not inherent in the patterns themselves, but evidence of a lack of expressivity in the languages of today. We expect that, in the languages of the future, the code parts of design patterns will be expressible as reusable library components. Indeed, we claim that the languages of tomorrow will suffice; the future is not far away. All that is needed, in addition to commonlyavailable features, are higherorder and datatypegeneric constructs; these features are already or nearly available now. We argue the case by presenting higherorder datatypegeneric programs capturing ORIGAMI, a small suite of patterns for recursive data structures.
FUNCTIONAL PEARLS  Polytypic Unification
 Journal of Functional Programming
, 1998
"... Unification, or twoway pattern matching, is the process of solving an equation involving two firstorder terms with variables. Unification is used in type inference in many programming languages and in the execution of logic programs. This means that unification algorithms have to be written over a ..."
Abstract

Cited by 13 (3 self)
 Add to MetaCart
Unification, or twoway pattern matching, is the process of solving an equation involving two firstorder terms with variables. Unification is used in type inference in many programming languages and in the execution of logic programs. This means that unification algorithms have to be written over and over again for different termtypes. Many other functions also make sense for a large class of datatypes  examples are pretty printers, equality checks, maps etc. They can be defined by induction on the structure of userdefined datatypes. Implementations of these functions for different datatypes are closely related to the structure of the datatypes. We call such functions polytypic. This paper describes a unification algorithm parametrised on the type of the terms and shows how to use polytypism to obtain a unification algorithm that works for all regular term types.
Polytypic Programming With Ease
, 1999
"... A functional polytypic program is one that is parameterised by datatype. Since polytypic functions are defined by induction on types rather than by induction on values they typically operate on a higher level of abstraction than their monotypic counterparts. However, polytypic programming is not nec ..."
Abstract

Cited by 13 (5 self)
 Add to MetaCart
A functional polytypic program is one that is parameterised by datatype. Since polytypic functions are defined by induction on types rather than by induction on values they typically operate on a higher level of abstraction than their monotypic counterparts. However, polytypic programming is not necessarily more complicated than conventional programming. We show that a polytypic function is uniquely defined by its action on constant functors, projection functors, sums, and products. This information is sufficient to specialize a polytypic function to arbitrary polymorphic datatypes, including mutually recursive datatypes and nested datatypes. The key idea is to use infinite trees as index sets for polytypic functions and to interpret datatypes as algebraic trees. This approach appears both to be simpler, more general, and more efficient than previous ones which are based on the initial algebra semantics of datatypes. Polytypic functions enjoy polytypic properties. We show that wellkno...
Generics as a Library
 Proceedings of the Seventh Symposium on Trends in Functional Programming
, 2006
"... A generic function is a function that is defined on the structure of data types: with a single definition, we obtain a function that works for many data types. In contrast, an adhoc polymorphic function requires a separate implementation for each data type. Previous work by Hinze on lightweight ..."
Abstract

Cited by 4 (4 self)
 Add to MetaCart
A generic function is a function that is defined on the structure of data types: with a single definition, we obtain a function that works for many data types. In contrast, an adhoc polymorphic function requires a separate implementation for each data type. Previous work by Hinze on lightweight generic programming has introduced techniques that allow the definition of generic functions directly in Haskell.
Patterns and Lax Lambda Laws for Relational and Imperative Programming

"... Pointfree relation calculi have been fruitful in functional programming, but in specific applications pointwise expressions can be more convenient and comprehensible than pointfree ones. To integrate pointwise with pointfree, de Moor and Gibbons [AMAST 2000] give a relational semantics for lamb ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
Pointfree relation calculi have been fruitful in functional programming, but in specific applications pointwise expressions can be more convenient and comprehensible than pointfree ones. To integrate pointwise with pointfree, de Moor and Gibbons [AMAST 2000] give a relational semantics for lambda terms with noninjective pattern matching. Alternative semantics has
Reductivity
, 1995
"... ing from these examples we propose the following definition: Definition 17 The relation R is said to be Fwellfounded if and only if, for all relations S , the equation 19 X:: X = S ffl F:X ffl R has a unique solution. 2 By design, R is wellfounded (in the conventional sense) if and only ..."
Abstract
 Add to MetaCart
ing from these examples we propose the following definition: Definition 17 The relation R is said to be Fwellfounded if and only if, for all relations S , the equation 19 X:: X = S ffl F:X ffl R has a unique solution. 2 By design, R is wellfounded (in the conventional sense) if and only if it is idwellfounded, where id is the identity relator. Moreover, the converse of any initial F algebra is Fwellfounded. A stronger statement can be made: Theorem 18 Suppose R is an F coalgebra that is a bijection between F:R? and R? . Then the following are all equivalent: (a) R is Fwellfounded, (b) R is F reductive, (c) R[ is an initial F algebra. 2 (The equivalence between (b) and (c) has already been observed.) One of the fundamental properties of reductivity is that it implies wellfoundedness. This is theorem 7 of [3]. The converse is not true. Let R be a nonempty, wellfounded relation (for example the relation succ[ on natural numbers) . Then it is easy to show th...
Polytypic Unification
, 1993
"... Unification, or twoway pattern matching, is the process of solving an equation involving two firstorder terms with variables. Unification is used in type inference in many programming languages and in the execution of logic programs. This means that unification algorithms have to be written over a ..."
Abstract
 Add to MetaCart
Unification, or twoway pattern matching, is the process of solving an equation involving two firstorder terms with variables. Unification is used in type inference in many programming languages and in the execution of logic programs. This means that unification algorithms have to be written over and over again for different term types. Many other functions also make sense for a large class of datatypes, examples are pretty printers, equality checks, maps etc. They can be defined by induction on the structure of userdefined datatypes. Implementations of these functions for different datatypes are closely related to the structure of the datatypes. We call such functions polytypic. This paper describes a unification algorithm parametrised by the type of the terms and shows how to use polytypism to obtain a unification algorithm that works for all regular term types. 1 Introduction In simple pattern matching, a pattern (a string containing wild cards) is matched with a normal string...
Accumulating Attributes for Doaitse Swierstra, on his retirement
"... Abstract. Doaitse has always been enthusiastic about attribute grammars, seeing them even where most people don’t. While I was writing up my DPhil thesis, he explained to me where they were in that too. This paper is by way of belated thanks for that perspective—and as a more general rendering of th ..."
Abstract
 Add to MetaCart
Abstract. Doaitse has always been enthusiastic about attribute grammars, seeing them even where most people don’t. While I was writing up my DPhil thesis, he explained to me where they were in that too. This paper is by way of belated thanks for that perspective—and as a more general rendering of the observation, with the benefit of hindsight and twenty years of progress. 1