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. Simulations in existing systems suggest that this apparently self-supporting setup is achievable without paradox or infinite regress.
Supplemental Material
- }}A. Abel, T. Coquand, and M. Pagano. A modular type-checking algorithm for type theory with singleton types and proof irrelevance. In TLCA. Google Scholar
Digital Library
- }}R. Adams. Pure type systems with judgemental equality. JFP, 2006. Google Scholar
Digital Library
- }}T. Altenkirch and C. McBride. Generic programming within dependently typed programming. In Generic Programming, 2002. Google Scholar
Digital Library
- }}T. Altenkirch and B. Reus. Monadic presentations of lambda terms using generalized inductive types. In Computer Science Logic. 1999. Google Scholar
Digital Library
- }}T. Altenkirch, C. McBride, and W. Swierstra. Observational equality, now! In PLPV, 2007. Google Scholar
Digital Library
- }}L. Augustsson and M. Carlsson. An exercise in dependent types: A well-typed interpreter. Available at http://www.cs.chalmers.se/~augustss/cayenne/interp.ps, 1999.Google Scholar
- }}M. Benke, P. Dybjer, and P. Jansson. Universes for generic programs and proofs in dependent type theory. Nordic Journal of Computing, 2003. Google Scholar
Digital Library
- }}E. Brady, J. Chapman, P.-E. Dagand, A. Gundry, C. McBride, P. Morris, and U. Norell. An Epigram implementation.Google Scholar
- }}E. Brady, C. McBride, and J. McKinna. Inductive families need not store their indices. In TYPES, 2003.Google Scholar
- }}J. Cheney and R. Hinze. First-class phantom types. Technical report, Cornell University, 2003.Google Scholar
- }}T. Coquand. An algorithm for type-checking dependent types. SCP, 1996. Google Scholar
Digital Library
- }}J. Courant. Explicit universes for the calculus of constructions. In TPHOLs, 2002. Google Scholar
Digital Library
- }}N. A. Danielsson. The Agda standard library, 2010.Google Scholar
- }}P. Dybjer. Inductive sets and families in Martin-Löf's type theory. In Logical Frameworks. 1991. Google Scholar
Digital Library
- }}P. Dybjer and A. Setzer. A finite axiomatization of inductive-recursive definitions. In TLCA, 1999. Google Scholar
Digital Library
- }}P. Dybjer and A. Setzer. Induction-recursion and initial algebras. In Annals of Pure and Applied Logic, 2000.Google Scholar
- }}P. Dybjer and A. Setzer. Indexed induction-recursion. In Proof Theory in Computer Science. 2001. Google Scholar
Digital Library
- }}R. Garcia, J. Jarvi, A. Lumsdaine, J. Siek, and J. Willcock. A comparative study of language support for generic programming. In OOPSLA, 2003. Google Scholar
Digital Library
- }}H. Geuvers. Induction is not derivable in second order dependent type theory. In TLCA, 2001. Google Scholar
Digital Library
- }}H. Goguen, C. McBride, and J. McKinna. Eliminating dependent pattern matching. In Algebra, Meaning and Computation. 2006.Google Scholar
- }}R. Harper and R. Pollack. Type checking with universes. In TAPSOFT'89. Google Scholar
Digital Library
- }}R. Hinze. Polytypic values possess polykinded types. In MPC. 2000. Google Scholar
Digital Library
- }}R. Hinze, J. Jeuring, and A. Löh. Type-indexed data types. In MPC, 2002. Google Scholar
Digital Library
- }}R. Hinze, J. Jeuring, and A. Löh. Comparing approaches to generic programming in Haskell. In Datatype-Generic Programming. 2007. Google Scholar
Digital Library
- }}S. Holdermans, J. Jeuring, A. Löh, and A. Rodriguez. Generic views on data types. In MPC. 2006. Google Scholar
Digital Library
- }}P. Jansson and J. Jeuring. PolyP - a polytypic programming language extension. In POPL, 1997. Google Scholar
Digital Library
- }}R. Lämmel and S. Peyton Jones. Scrap your boilerplate: a practical design pattern for generic programming. In TLDI, 2003.Google Scholar
Digital Library
- }}D. R. Licata and R. Harper. A universe of binding and computation. In ICFP, 2009. Google Scholar
Digital Library
- }}Z. Luo. Computation and Reasoning. Oxford University Press, 1994. Google Scholar
Digital Library
- }}P. Martin-Löf. Intuitionistic Type Theory. Bibliopolis•Napoli, 1984.Google Scholar
- }}C. McBride and J. McKinna. The view from the left JFP, 2004. Google Scholar
Digital Library
- }}P. Morris. Constructing Universes for Generic Programming. PhD thesis, University of Nottingham, 2007.Google Scholar
- }}P. Morris and T. Altenkirch. Indexed containers. In LICS, 2009. Google Scholar
Digital Library
- }}P. Morris, T. Altenkirch, and C. McBride. Exploring the regular tree types. In TYPES, 2004. Google Scholar
Digital Library
- }}P. Morris, T. Altenkirch, and N. Ghani. A universe of strictly positive families. IJCS, 2009.Google Scholar
Cross Ref
- }}U. Norell. Functional generic programming and type theory. Master’s thesis, Chalmers University of Technology, 2002.Google Scholar
- }}U. Norell. Towards a practical programming language based on dependent type theory. PhD thesis, Chalmers University of Technology, 2007.Google Scholar
- }}N. Oury and W. Swierstra. The power of Pi. In ICFP, 2008. Google Scholar
Digital Library
- }}C. Paulin-Mohring. Définitions inductives en théorie des types d’ordre supérieur. thèse d’habilitation, ENS Lyon, 1996.Google Scholar
- }}B. C. Pierce and D. N. Turner. Local type inference. In POPL, 1998. Google Scholar
Digital Library
- }}A. Rodriguez, J. Jeuring, P. Jansson, A. Gerdes, O. Kiselyov, and B. C. d. S. Oliveira. Comparing libraries for generic programming in Haskell. In Haskell Symposium, 2008. Google Scholar
Digital Library
- }}The Coq Development Team. The Coq Proof Assistant Reference Manual.Google Scholar
- }}W. Verbruggen, E. de Vries, and A. Hughes. Polytypic programming in Coq. In WGP, 2008. Google Scholar
Digital Library
- }}W. Verbruggen, E. de Vries, and A. Hughes. Polytypic properties and proofs in Coq. In WGP, 2009. Google Scholar
Digital Library
- }}S. Weirich and C. Casinghino. Arity-generic datatype-generic programming. In PLPV, 2010. Google Scholar
Digital Library
- }}H. Xi, C. Chen, and G. Chen. Guarded recursive datatype constructors. In POPL, 2003. Google Scholar
Digital Library
- }}A. R. Yakushev, S. Holdermans, A. Löh, and J. Jeuring. Generic programming with fixed points for mutually recursive datatypes. In ICFP, 2009. Google Scholar
Digital Library
Index Terms
The gentle art of levitation
Recommendations
The gentle art of levitation
ICFP '10: Proceedings of the 15th ACM SIGPLAN international conference on Functional programmingWe 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 ...
Typing constraint logic programs
We present a prescriptive type system with parametric polymorphism and subtyping for constraint logic programs. The aim of this type system is to detect programming errors statically. It introduces a type discipline for constraint logic programs and ...
Incremental type-checking for type-reflective metaprograms
GPCE '10: Proceedings of the ninth international conference on Generative programming and component engineeringGarcia introduces a calculus for type-reflective metaprogramming that provides much of the power and flexibility of C++ templates and solves many of its problems. However, one of the problems that remains is that the residual program is not type checked ...







Comments