## The Gentle Art of Levitation

### Cached

### Download Links

Citations: | 23 - 4 self |

### BibTeX

@MISC{Chapman_thegentle,

author = {James Chapman and Pierre-évariste Dagand and Conor Mcbride and Peter Morris},

title = {The Gentle Art of Levitation},

year = {}

}

### OpenURL

### Abstract

We present a closed dependent type theory whose inductive types are given not by a scheme for generative declarations, but by encoding in a universe. Each inductive datatype arises by interpreting its description—a first-class value in a datatype of descriptions. Moreover, the latter itself has a description. Datatype-generic programming thus becomes ordinary programming. We show some of the resulting generic operations and deploy them in particular, useful ways on the datatype of datatype descriptions itself. Surprisingly this apparently self-supporting setup is achievable without paradox or infinite regress. 1.

### Citations

350 |
Intuitionistic Type Theory
- MARTIN-LÖF
- 1984
(Show Context)
Citation Context ... and extending the language for defining values and programs. However, dependent type systems also allow us to reflect types as the image of a function from a set of ‘codes’— a universe construction [=-=Martin-Löf 1984-=-]. Computing with codes, we expose operations on and relationships between the types they reflect. Here, we adopt the universe as our guiding design principle. We abolish the datatype declaration cons... |

183 | Towards a Practical Programming Language based on Dependent Type Theory
- Norell
- 2007
(Show Context)
Citation Context ... They allow us to function in a complex world with a higher standard of basic hygiene than is practical with the context-free datatypes of ML-like languages. Dependent type systems, as found in Agda [=-=Norell 2007-=-], Coq [The Coq Development Team 2009], Epigram [McBride and McKinna 2004], and contemporary Haskell [Peyton Jones et al. 2006], are beginning to make themselves useful. As with rope, the engineering ... |

176 | PolyP — a polytypic programming language extension
- Jansson, Jeuring
- 1997
(Show Context)
Citation Context ...ate descriptions as first-class objects: the catamorphism is, basically, a function mapping a Desc to a datatype specific operation. This is a form of polytypic programming, as we learned from PolyP [=-=Jansson and Jeuring 1997-=-]. 4.4 The generic free monad In this section, we will turn to a more ambitious generic operation on datatype. Given a functor, represented as a tagged description, we build the free monad over this f... |

170 | Local type inference
- Pierce, Turner
(Show Context)
Citation Context ...:S) × T Γ ⊩ π1 p ⊲ π1 p ′ ∈ T [π0 p ′ /x] Figure 1. Type synthesis Our approach to tidying the coding cruft is deeply rooted in the bidirectional presentation of type checking from Pierce and Turner [=-=Pierce and Turner 1998-=-]. They divide type inference into two communicating components. In type synthesis, types are pulled out of terms. A typical example is a variable in the context: Γ; x :S; ∆ ⊢ VALID Γ; x :S; ∆ ⊢ x :S ... |

166 | Simple unification-based type inference for GADTs
- Jones, Vytiniotis, et al.
- 2006
(Show Context)
Citation Context ...-free datatypes of ML-like languages. Dependent type systems, as found in Agda [Norell 2007], Coq [The Coq Development Team 2009], Epigram [McBride and McKinna 2004], and contemporary Haskell [Peyton =-=Jones et al. 2006-=-], are beginning to make themselves useful. As with rope, the engineering benefits of type indexing sometimes outweigh the difficulties you can arrange with enough of it. The blessing of expressing ju... |

160 |
The view from the left
- McBride, McKinna
(Show Context)
Citation Context ...standard of basic hygiene than is practical with the context-free datatypes of ML-like languages. Dependent type systems, as found in Agda [Norell 2007], Coq [The Coq Development Team 2009], Epigram [=-=McBride and McKinna 2004-=-], and contemporary Haskell [Peyton Jones et al. 2006], are beginning to make themselves useful. As with rope, the engineering benefits of type indexing sometimes outweigh the difficulties you can arr... |

149 | Scrap your boilerplate: a practical design pattern for generic programming - Lämmel, Jones - 2003 |

136 | Guarded recursive datatype constructors - Xi, Chen, et al. - 2003 |

110 | First-class phantom types - Cheney, Hinze - 2003 |

106 | Polytypic values possess polykinded types
- Hinze
(Show Context)
Citation Context ...ic Haskell, we do not have to modify the compiler to obtain views on datatypes: we can massage descriptions from inside our language. Unlike Generic Haskell, we do not support polykinded programming [=-=Hinze 2000-=-]. Our descriptions are limited to endofunctors on SET and SET I . While we could encode higher-kinded datatypes, we do not plan to adopt this strategy. As future work, we plan to extend our universe ... |

85 | A Comparative Study of Language Support for Generic - Gracia, Järvi, et al. - 2003 |

79 | B.: Monadic presentations of lambda terms using generalized inductive types - Altenkirch, Reus - 1999 |

78 | Inductive sets and families in Martin-Löf’s type theory and their settheoretic semantics
- Dybjer
- 1991
(Show Context)
Citation Context ...ts datatypes. We warm up with a universe of simple datatypes, just sufficient to describe itself. Once we have learned this art, we scale up to indexed datatypes, encompassing the inductive families [=-=Dybjer 1991-=-; Luo 1994] found in Coq and Epigram, and delivering experiments in generic programming with applications to the datatype of codes itself. We aim to deliver proof of concept, showing that a closed the... |

59 | Typeindexed data types
- Hinze, Jeuring, et al.
- 2004
(Show Context)
Citation Context ...ype, to extend it with a notion of variable. Then, we have equipped this structure with the corresponding monadic operation, bind and return. This construction is an example of type-indexed datatype [=-=Hinze et al. 2002-=-], as found in Generic Haskell: from a datatype, we build a new datatype and equip it with its structure. 5. A Universe of Inductive Families So far, we have explored the well-known realm of inductive... |

55 | Generic programming within dependently typed programming - Altenkirch, McBride |

45 | An algorithm for type-checking dependent types
- Coquand
- 1996
(Show Context)
Citation Context ...quivalence of β-normal forms [Adams 2006]. Coquand and Abel feature prominently in a literature of richer equalities, involving η-expansion, proof-irrelevance and other attractions [Abel et al. 2009; =-=Coquand 1996-=-]. Agda and Epigram 2 support such features, Coq currently does not, but they are surplus to requirements here. Context validity ensures that variables inhabit well-formed sets. ⊢ VALID Γ ⊢ S : SET x ... |

44 | Indexed induction-recursion - Dybjer, Setzer |

43 | Universes for generic programs and proofs in dependent type theory - Benke, Dybjer, et al. |

43 | A finite axiomatization of inductive-recursive definitions
- Dybjer, Setzer
- 1998
(Show Context)
Citation Context ...a similar treatment. Benke, Dybjer and Jansson [Benke et al. 2003] provide a useful survey of the possibilities, including extension to inductive-recursive definition, whose closed-form presentation [=-=Dybjer and Setzer 1999-=-, 2000] is both an inspiration for the present enterprise, and a direction for future study. The work of Morris, Altenkirch and Ghani [Morris 2007; Morris and Altenkirch 2009; Morris et al. 2009] on (... |

39 | Inductive families need not store their indices - Brady, McBride, et al. - 2004 |

29 | Induction-recursion and initial algebras - Dybjer, Setzer - 2003 |

28 |
Interprétation functionelle et élimination des coupures dans l’arithmétique d’ordre supérieure
- Girard
- 1972
(Show Context)
Citation Context ...l-formed sets. ⊢ VALID Γ ⊢ S : SET x ̸∈ Γ Γ; x :S ⊢ VALID The basic typing rules for tuples and functions are also standard, save that we locally adopt SET : SET, putting presentation before paradox [=-=Girard 1972-=-]. The usual remedies apply, stratifying SET [Courant 2002; Harper and Pollack 1991; Luo 1994]. Γ; x :S; ∆ ⊢ VALID Γ; x :S; ∆ ⊢ x :S Γ ⊢ VALID Γ ⊢ SET : SET Γ ⊢ s :S Γ ⊢ VALID Γ ⊢ 1: SET Γ ⊢ S : SET Γ... |

25 | Observational equality, now - Altenkirch, McBride, et al. - 2007 |

25 | Type checking with universes
- Harper, Pollack
- 1991
(Show Context)
Citation Context ...ing rules for tuples and functions are also standard, save that we locally adopt SET : SET, putting presentation before paradox [Girard 1972]. The usual remedies apply, stratifying SET [Courant 2002; =-=Harper and Pollack 1991-=-; Luo 1994]. Γ; x :S; ∆ ⊢ VALID Γ; x :S; ∆ ⊢ x :S Γ ⊢ VALID Γ ⊢ SET : SET Γ ⊢ s :S Γ ⊢ VALID Γ ⊢ 1: SET Γ ⊢ S : SET Γ; x :S ⊢ T : SET Γ ⊢ (x :S) × T : SET Γ ⊢ S ≡ T : SET Γ ⊢ s :T Γ ⊢ VALID Γ ⊢ []:1 Γ... |

25 | Generic views on data types
- Holdermans, Jeuring, et al.
- 2006
(Show Context)
Citation Context ...roach [Hinze et al. 2002], as exemplified by the free monad construction: from datatype, we can compute new datatypes and equip them with their structure. Generic Haskell also features generic views [=-=Holdermans et al. 2006-=-], transparently transforming the structure of datatype definitions. An example is the tagged descriptions, presenting datatypes under a sum-of-sigmas angle. Unlike Generic Haskell, we do not have to ... |

24 | Indexed containers
- Altenkirch, Morris
- 2009
(Show Context)
Citation Context ...ose closed-form presentation [Dybjer and Setzer 1999, 2000] is both an inspiration for the present enterprise, and a direction for future study. The work of Morris, Altenkirch and Ghani [Morris 2007; =-=Morris and Altenkirch 2009-=-; Morris et al. 2009] on (indexed) containers has informed our style of encoding and the equipment we choose to develop, but the details here reflect pragmatic concerns about intensional properties wh... |

24 | An exercise in dependent types: A well-typed interpreter - Augustsson, Carlsson - 1999 |

20 | The power of Pi
- Oury, Swierstra
- 2008
(Show Context)
Citation Context ...ructure which ties these nodes together. Not for the first time, we do this by constructing a universe [Martin-Löf 1984]. Universes are ubiquitous in dependently typed programming [Benke et al. 2003; =-=Oury and Swierstra 2008-=-], but here we seek to exploit them as the foundation of our notion of datatypes. To add inductive types to our type theory, we build a universe of datatype descriptions by implementing the signature ... |

19 |
Constructing Universes for Generic Programming
- Morris
- 2007
(Show Context)
Citation Context ...efinition, whose closed-form presentation [Dybjer and Setzer 1999, 2000] is both an inspiration for the present enterprise, and a direction for future study. The work of Morris, Altenkirch and Ghani [=-=Morris 2007-=-; Morris and Altenkirch 2009; Morris et al. 2009] on (indexed) containers has informed our style of encoding and the equipment we choose to develop, but the details here reflect pragmatic concerns abo... |

17 | A universe of binding and computation - Licata, Harper - 2009 |

16 | Computation and Reasoning - Luo - 1994 |

16 | Définitions Inductives en Théorie des Types d’Ordre Supérieur. Habilitation à diriger les recherches - Paulin-Mohring - 1996 |

15 | Pure Type Systems with Judgemental Equality - Adams |

15 | Comparing approaches to generic programming in Haskell - Hinze, Jeuring, et al. - 2007 |

10 | Eliminating dependent pattern matching
- Goguen, McBride, et al.
- 2006
(Show Context)
Citation Context ...f ⊲ f ′ Γ ⊩ (x :µD) → P ∋ �f ⊲ ind D (λµDx. P) f ′ This abbreviation is no substitute for the dependent pattern matching to which we are entitled in a high-level language built on top of this theory [=-=Goguen et al. 2006-=-], but it does at least make ‘assembly language’ programming mercifully brief, if hieroglyphic. plus : Nat → Nat → Nat plus ↦→ �∧[(λ . λ . λy. y) (λ . ∧λh. λ . λy. ’suc (h y))] This concludes our intr... |

10 | A universe of strictly positive families - Morris, Altenkirch, et al. - 2007 |

8 | Explicit universes for the calculus of constructions
- Courant
- 2002
(Show Context)
Citation Context ... The basic typing rules for tuples and functions are also standard, save that we locally adopt SET : SET, putting presentation before paradox [Girard 1972]. The usual remedies apply, stratifying SET [=-=Courant 2002-=-; Harper and Pollack 1991; Luo 1994]. Γ; x :S; ∆ ⊢ VALID Γ; x :S; ∆ ⊢ x :S Γ ⊢ VALID Γ ⊢ SET : SET Γ ⊢ s :S Γ ⊢ VALID Γ ⊢ 1: SET Γ ⊢ S : SET Γ; x :S ⊢ T : SET Γ ⊢ (x :S) × T : SET Γ ⊢ S ≡ T : SET Γ ⊢ ... |

7 | Functional generic programming and type theory, 2002. MSc thesis - Norell |

3 | Polytypic programming in Coq - Verbruggen, Vries, et al. - 2008 |

2 | Induction is not derivable in second order dependent type theory
- Geuvers
- 2001
(Show Context)
Citation Context ...ve Church-style encoding of datatypes is not adequate for dependently typed programming, as although such encodings present data as non-dependent eliminators, they do not support dependent induction [=-=Geuvers 2001-=-]. Whilst the λ-calculus captures all that data can do, it cannot ultimately delimit all that data can be. 3.1 The power of Σ In dependently typed languages, Σ-types can be interpreted as two differen... |

2 | Polytypic properties and proofs in Coq - Verbruggen, Vries, et al. - 2009 |

2 | The view from the left. JFP - McBride, McKinna - 2004 |

1 | An Epigram implementation
- Brady, Chapman, et al.
- 2009
(Show Context)
Citation Context ...details here reflect pragmatic concerns about intensional properties which demand care in practice. We have thus been able to implement our work as the basis for datatypes in the Epigram 2 prototype [=-=Brady et al. 2009-=-]. We have also developed a stratified model of our coding scheme in Agda 1 . 2. The Type Theory One challenge in writing this paper is to extricate our account of datatypes from what else is new in E... |

1 | The Agda standard library - Danielsson - 2010 |

1 | The Coq Development Team. The Coq Proof Assistant Reference Manual - Symposium - 2008 |