## Covariant Types (1997)

Venue: | Theoretical Computer Science |

Citations: | 3 - 2 self |

### BibTeX

@TECHREPORT{Jay97covarianttypes,

author = {C. Barry Jay},

title = {Covariant Types},

institution = {Theoretical Computer Science},

year = {1997}

}

### OpenURL

### Abstract

The covariant type system is an impredicative system that is rich enough to represent some polymorphism on inductive types, such as lists and trees, and yet is simple enough to have a set-theoretic semantics. Its chief novelty is to replace function types by transformation types, which denote parametric functions. Their free type variables are all in positive positions, and so can be modelled by covariant functors. Similarly, terms denote natural transformations. There is a translation from the covariant type system to system F which preserves non-trivial reductions. It follows that covariant reduction is strongly normalising and confluent. This work suggests a new approach to the semantics of system F, and new ways of basing type systems on the categorical notions of functor and natural transformation. Keywords covariant types, polymorphism, parametricity, transformation types. 1 Introduction The pros and cons of typing programs are already well known. In brief, static type-checkin...

### Citations

1619 | The De of Standard ML
- Milner, Tofte, et al.
- 1990
(Show Context)
Citation Context ...) types. The second drawback is handled by introducing parametric polymorphism, whereby a program can take a variable type, that can then be instantiated to suit the circumstances. For example, in ML =-=[MT91]-=- the appending of lists can be given type append : 'a list -? 'a list -? 'a list where 'a can be instantiated to any type whatsoever. Such parametric programs can be studied abstractly in the underlyi... |

978 | A theory of type polymorphism in programming
- Milner
- 1978
(Show Context)
Citation Context ... list where 'a can be instantiated to any type whatsoever. Such parametric programs can be studied abstractly in the underlying type system. For example, ML is based on the Hindley-Milner type system =-=[Mil78]-=- (here denoted HM) which can be viewed as a fragment of the second-order polymorphic lambda-calculus [Rey85], also known as system F of variable types [GLT89]. Let us briefly review these type systems... |

455 | Computational lambda-calculus and monads - Moggi - 1989 |

377 |
Types, abstraction and parametric polymorphism
- Reynolds
- 1983
(Show Context)
Citation Context ...y in the underlying type system. For example, ML is based on the Hindley-Milner type system [Mil78] (here denoted HM) which can be viewed as a fragment of the second-order polymorphic lambda-calculus =-=[Rey85]-=-, also known as system F of variable types [GLT89]. Let us briefly review these type systems. 1 The monotypes and polytypes of HM are: T := X j T!T j T \ThetaT j T + T j X:Ts:= T j 8X: : It is a predi... |

307 | Functional programming with bananas, lenses, envelopes, and barbed wire
- Meijer, Fokkinga, et al.
- 1991
(Show Context)
Citation Context ...expresses its initiality among all such algebras. That is, if S is a T -algebra, with T -action 6 f : T [S=X ])S then fold \Delta f : X:T)S is the corresponding algebra homomorphism (or catamorphism, =-=[MFP91]-=-) from the initial T -algebra X:T to S. For fst; snd and pair we can instantiate the type variables in their types during application, as follows: fst S;T = x : S \ThetaT : fst \Delta x snd S;T = x : ... |

230 | Report on the programming language Haskell: a non-strict, purely functional language. Version 1.2
- Hudak, Jones, et al.
- 1992
(Show Context)
Citation Context ...A basic operation on any inductive type is to map a function across all of the data stored within one of its values. This functoriality may be left to the user to define, perhaps through type classes =-=[HPJW92]-=- or constructor classes [Jon95]. An alternative adopted here, and in polytypic pattern matching [Jeu95] is to use type information to determine the action of mapping. A third approach is to use shape ... |

182 | A system of constructor classes: overloading and implicit higher-order polymorphism
- Jones
- 1993
(Show Context)
Citation Context ...ve type is to map a function across all of the data stored within one of its values. This functoriality may be left to the user to define, perhaps through type classes [HPJW92] or constructor classes =-=[Jon95]-=-. An alternative adopted here, and in polytypic pattern matching [Jeu95] is to use type information to determine the action of mapping. A third approach is to use shape polymorphism to determine the a... |

105 | On the type structure of standard ML
- Harper, Mitchell
- 1993
(Show Context)
Citation Context ... of a type is defined from that of its sub-types. This allows us to build set-theoretic models based on a pair of universes, and a "truly full set-theoretic model" if we have an inaccessible=-= cardinal [HM93]-=-. The types of F are given by: T := X j T!T j 8X:T : This compact system is powerful enough to represent all HM types since binary products, binary sums, and recursive types (initial algebras) can be ... |

62 | A semantics of shape
- Jay
- 1995
(Show Context)
Citation Context ...d into their shape and their data. This separation can be modelled formally, has strong properties, and can be exploited in the design of programs and programming languages. The original presentation =-=[Jay95b]-=- used finite lists to represent the data: recent work [Jay96a] generalises these to position functors. These use an object of positions 3 as a means of indexing data locations. Shape information is us... |

50 | Strong categorical datatypes I - Cockett, Spencer |

49 | Strong functors and monoidal monads - Kock - 1972 |

49 |
Polymorphism is set-theoretic constructively
- Pitts
- 1988
(Show Context)
Citation Context ...mantics [Rey84]. Instead of accepting Reynolds' result at face value, the semantics community rose to the challenge of producing models of F in categories other than Sets, notably the effective topos =-=[Pit87]-=- and categories of partial equivalence relations [LM91]. In each case, realisability, a computational concept, was used to limit the size of the products required to model quantification. These models... |

47 |
Polymorphism is not set-theoretic
- Reynolds
- 1984
(Show Context)
Citation Context ...ubstitutions of types for X in T . This suggests that the semantics of F should be even harder to fathom; Reynolds proved that, under certain mild assumptions, system F has no set-theoretic semantics =-=[Rey84]-=-. Instead of accepting Reynolds' result at face value, the semantics community rose to the challenge of producing models of F in categories other than Sets, notably the effective topos [Pit87] and cat... |

28 | Polytypic pattern matching
- Jeuring
- 1995
(Show Context)
Citation Context ... its values. This functoriality may be left to the user to define, perhaps through type classes [HPJW92] or constructor classes [Jon95]. An alternative adopted here, and in polytypic pattern matching =-=[Jeu95]-=- is to use type information to determine the action of mapping. A third approach is to use shape polymorphism to determine the action of map [Jay95b, BJM96] For each triplet R; S; T of types, and type... |

27 | Functorial ML
- BellĂ¨, Jay, et al.
- 1996
(Show Context)
Citation Context ... of ML which supports an additional syntactic class of functors (i.e. categorical functors rather than the standard ML functors). Shape polymorphism is expressed by quantifying over functor variables =-=[BJM96]-=-. This ML extension contains ordinary function types, and so is not covariant. However, we can imagine adapting the type of map to be map : 8F; G; H: (F)G))(HF)HG) where HF is the composite of functor... |

11 | Polynomial polymorphism
- Jay
- 1995
(Show Context)
Citation Context ... Of course, this takes us beyond the possibilities of F (or even F! ) since there the type of a shape polymorphicsmap is empty. However, shape polymorphism makes sense semantically and the language P2=-=[Jay95a]-=- provides the kernel of a system that supports shapepolymorphicsmap and fold. This is further developed in FML, an extension of ML which supports an additional syntactic class of functors (i.e. catego... |

7 | Data categories
- Jay
- 1996
(Show Context)
Citation Context ...lled formally, has strong properties, and can be exploited in the design of programs and programming languages. The original presentation [Jay95b] used finite lists to represent the data: recent work =-=[Jay96a]-=- generalises these to position functors. These use an object of positions 3 as a means of indexing data locations. Shape information is used to determine which positions store a datum. The result is a... |

6 |
Locally Presentable and Accessible Categories. London Mathematical Society Lecture Note Series 189
- Ad'amek, Rosick'y
- 1994
(Show Context)
Citation Context ...lass of natural transformations between a pair of endo-functors on Sets, e.g. from the covariant powerset functor to itself. One solution would be to restrict to functors on Sets with rank (e.g., see =-=[AR94]-=-). While this approach is adequate to the task (and perhaps form a largest model) this paper will focus on a smaller solution, provided by the theory of shape, whose outlines we will now review. Shape... |

3 |
Constructive natural deduction and its "!-set" interpretation
- Longo, Moggi
- 1991
(Show Context)
Citation Context ...t face value, the semantics community rose to the challenge of producing models of F in categories other than Sets, notably the effective topos [Pit87] and categories of partial equivalence relations =-=[LM91]-=-. In each case, realisability, a computational concept, was used to limit the size of the products required to model quantification. These models demonstrate the accuracy of some basic intuitions, e.g... |

1 | A fresh look at parametric polymorphism: covariant types
- Jay
- 1996
(Show Context)
Citation Context ...to establish strong normalisation and confluence of covariant reduction, and underpins a discussion of the semantics of F. Section 7 draws conclusions. A preliminary version of this paper appeared as =-=[Jay96b]-=-. 2 The covariant type system 2.1 Types The (raw) types are given by: T ::= X j T)T j T \ThetaT j T + T j X:T : The actual types are equivalence classes of raw types under ff-conversion of bound varia... |