Abstract:
Abstract. A polytypic value is one that is dened by induction on the structure of types. In Haskell types are assigned so-called kinds that distinguish 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 xed kind. In this paper we show how to dene values that are indexed by types of arbitrary kinds. It turns out 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 denition yields mapping functions for datatypes of arbitrary kinds including rstand higher-order functors. Polytypic values enjoy polytypic properties. Using kind-indexed logical relations we prove among other things that the polytypic mapping function satises suitable generalizations of the functorial laws. 1
Citations
|
826
|
A theory of type polymorphism in programming
– Milner
- 1978
|
|
255
|
Foundations of Programming Languages
– Mitchell
- 1996
|
|
231
|
Interprétation fonctionelle et élimination des coupures de l’arithmétique d’ordre supérieur
– Girard
- 1972
|
|
227
|
Theorems for free
– Wadler
- 1989
|
|
163
|
PolyP - a polytypic programming language extension
– Jansson, Jeuring
- 1997
|
|
157
|
Purely Functional Data Structures
– Okasaki
- 1998
|
|
88
|
Polymorphic type inference
– Leivant
- 1983
|
|
81
|
A new approach to generic functional programming
– Hinze
|
|
77
|
Generic programming: An introduction
– Backhouse, Jansson, et al.
- 1999
|
|
77
|
Bananas in space: Extending fold and unfold to exponential types
– Meijer, Hutton
- 1995
|
|
65
|
Nested datatypes
– Bird, Meertens
- 1998
|
|
53
|
Compiling Haskell by program transformation: a report from the trenches
– Jones
- 1996
|
|
49
|
Merging monads and folds for functional programming
– Meijer, Jeuring
- 1995
|
|
41
|
Calculate polytypically
– Meertens
- 1996
|
|
30
|
An investigation of a programming language with a polymorphic type structure
– McCracken
- 1979
|
|
26
|
Functorial ML
– Bell'e, Jay, et al.
- 1996
|
|
24
|
The finitary projection model for second order lambda calculus and solutions to higher order domain equations
– Amadio, Bruce, et al.
- 1986
|
|
20
|
Polytypic data conversion programs
– Jansson, Jeuring
|
|
19
|
Oege de Moor, and Paul Hoogendijk. Generic functional programming with types and relations
– Bird
- 1996
|
|
18
|
Monadic maps and folds for arbitrary datatypes
– Fokkinga
- 1994
|
|
17
|
Analytical and Structural Polymorphism Expressed Using Patterns Over Types
– Ruehr
- 1992
|
|
15
|
Polytypic functions over nested datatypes
– Hinze
- 1999
|
|
14
|
When do datatypes commute
– Hoogendijk, Backhouse
- 1997
|
|
13
|
Polytypic Programming with Ease
– Hinze
- 1999
|
|
12
|
PolyLib--A library of polytypic functions.In
– Jansson, Jeuring
- 1998
|
|
10
|
Polymorphic type schemes and recursive de
– Mycroft
- 1984
|
|
6
|
Available from http://www.haskell.org/hugs
– Jones, Peterson
- 1999
|