Abstract
System FC, the core language of the Glasgow Haskell Compiler, is an explicitly-typed variant of System F with first-class type equality proofs called coercions. This extensible proof system forms the foundation for type system extensions such as type families (type-level functions) and Generalized Algebraic Datatypes (GADTs). Such features, in conjunction with kind polymorphism and datatype promotion, support expressive compile-time reasoning.
However, the core language lacks explicit kind equality proofs. As a result, type-level computation does not have access to kind-level functions or promoted GADTs, the type-level analogues to expression-level features that have been so useful. In this paper, we eliminate such discrepancies by introducing kind equalities to System FC. Our approach is based on dependent type systems with heterogeneous equality and the "Type-in-Type" axiom, yet it preserves the metatheoretic properties of FC. In particular, type checking is simple, decidable and syntax directed. We prove the preservation and progress theorems for the extended language.
- T. Altenkirch and C. McBride. Generic programming within dependently typed programming. In J. Gibbons and J. Jeuring, editors, Generic Programming, volume 243 of IFIP Conference Proceedings, pages 1--20. Kluwer, 2002. Google Scholar
Digital Library
- T. Altenkirch, C. McBride, and W. Swierstra. Observational equality, now! In Proceedings of the 2007 workshop on Programming Languages meets Program Verification, PLPV '07, pages 57--68, New York, 2007. ACM. Google Scholar
Digital Library
- L. Augustsson. Cayenne--a language with dependent types. In Proceedings of the third ACM SIGPLAN International Conference on Functional Programming, ICFP '98, pages 239--250, New York, 1998. ACM. 10.1145/289423.289451. Google Scholar
Digital Library
- H. P. Barendregt. Handbook of logic in computer science (vol. 2). chapter Lambda calculi with types, pages 117--309. Oxford University Press, New York, 1992. Google Scholar
Digital Library
- B. Barras and B. Bernardo. The implicit calculus of constructions as a programming language with dependent types. In Foundations of Software Science and Computational Structures, volume 4962 of Lecture Notes in Computer Science, pages 365--379. Springer, Berlin, Heidelberg, 2008. Google Scholar
Digital Library
- L. Cardelli. A polymorphic lambda calculus with type:type. Technical Report 10, Digital Equipment Corporation Systems Research Center, 1986.Google Scholar
- M. M. T. Chakravarty, G. Keller, and S. Peyon Jones. Associated type synonyms. In Proceedings of the tenth ACM SIGPLAN International Conference on Functional Programming, ICFP '05, pages 241--253, New York, 2005. ACM. Google Scholar
Digital Library
- K. Crary, S. Weirich, and G. Morrisett. Intensional polymorphism in type erasure semantics. In Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming, ICFP '98, pages 301--313, Baltimore, MD, USA, 1998. ACM. Google Scholar
Digital Library
- R. A. Eisenberg and S. Weirich. Dependently typed programming with singletons. In Proceedings of the 2012 Haskell Symposium, Haskell '12, pages 117--130, New York, 2012. ACM. Google Scholar
Digital Library
- H. Geuvers and F. Wiedijk. A logical framework with explicit conversions. In C. Schuermann, editor, LFM'04, Proceedings of the Fourth International Workshop on Logical Frameworks and Meta-Languages, Cork, Ireland, pages 32--45, 2004.Google Scholar
- J.-Y. Girard. Interprétation fonctionnelle et élimination des coupures de l'arithmétique d'ordre supérieu. PhD thesis, Université de Paris VII, 1972.Google Scholar
- M. P. Jones. Type classes with functional dependencies. In 9th European Symposium on Programming, ESOP '00, volume 1782 of Lecture Notes in Computer Science, pages 230--244. Springer, 2000. Google Scholar
Digital Library
- Fu, Sheard, Weirich, Casinghino, Sjöberg, Collins, and Ahn}kimmel:plpvG. Kimmell, A. Stump, H. D. Eades III, P. Fu, T. Sheard, S. Weirich, C. Casinghino, V. Sjöberg, N. Collins, and K. Y. Ahn. Equational reasoning about programs with general recursion and call-by-value semantics. In Sixth ACM SIGPLAN Workshop Programming Languages meets Program Verification (PLPV '12), 2012. Google Scholar
Digital Library
- D. R. Licata and R. Harper. Canonicity for 2-dimensional type theory. In Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, POPL '12, pages 337--348, New York, NY, USA, 2012. ACM. Google Scholar
Digital Library
- Z. Luo. Computation and reasoning: a type theory for computer science. Oxford University Press, Inc., New York, NY, USA, 1994. Google Scholar
Digital Library
- J. P. Magalhaes. The right kind of generic programming. In 8th ACM SIGPLAN Workshop on Generic Programming, WGP 2012, Copenhagen, Denmark, New York, NY, USA, 2012. ACM. Google Scholar
Digital Library
- P. Martin-Löf. Intuitionistic Type Theory. Bibliopolis, 1984.Google Scholar
- C. McBride. Elimination with a motive. In Selected papers from the International Workshop on Types for Proofs and Programs, TYPES '00, pages 197--216, London, UK, UK, 2002. Springer-Verlag. Google Scholar
Digital Library
- C. T. McBride. Agda-curious?: an exploration of programming with dependent types. In P. Thiemann and R. B. Findler, editors, ICFP, pages 1--2. ACM, 2012. ISBN 978-1-4503-1054-3. Google Scholar
Digital Library
- A. Miquel. The implicit calculus of constructions: extending pure type systems with an intersection type binder and subtyping. In Proceedings of the 5th international conference on Typed lambda calculi and applications, TLCA'01, pages 344--359, Berlin, Heidelberg, 2001. Springer-Verlag. Google Scholar
Digital Library
- U. Norell. Functional generic programming and type theory, 2002. MSc thesis.Google Scholar
- N. Oury and W. Swierstra. The power of Pi. In Proceedings of the 13th ACM SIGPLAN international conference on Functional programming, ICFP '08, pages 39--50, New York, NY, USA, 2008. ACM. ISBN 978-1-59593-919-7. Google Scholar
Digital Library
- S. Peyton Jones, D. Vytiniotis, S. Weirich, and G. Washburn. Simple unification-based type inference for GADTs. In Proceedings of the eleventh ACM SIGPLAN International Conference on Functional Programming, ICFP '06, pages 50--61, New York, NY, USA, 2006. ACM. Google Scholar
Digital Library
- T. Schrijvers, S. Peyton Jones, M. Sulzmann, and D. Vytiniotis. Complete and decidable type inference for GADTs. In Proceedings of the 14th ACM SIGPLAN international conference on Functional programming, ICFP '09, pages 341--352, New York, NY, USA, 2009. ACM. Google Scholar
Digital Library
- Fu, Kimmell, Sheard, Stump, and Weirich}sjoeberg:msfp12V. Sjöberg, C. Casinghino, K. Y. Ahn, N. Collins, H. D. Eades III, P. Fu, G. Kimmell, T. Sheard, A. Stump, and S. Weirich. Irrelevance, heterogenous equality, and call-by-value dependent type systems. In Fourth workshop on Mathematically Structured Functional Programming (MSFP '12), 2012.Google Scholar
- A. Stump, M. Deters, A. Petcher, T. Schiller, and T. Simpson. Verified programming in Guru. In Proceedings of the 3rd workshop on Programming languages meets program verification, PLPV '09, pages 49--58, New York, NY, USA, 2008. ACM. Google Scholar
Digital Library
- M. Sulzmann, M. M. T. Chakravarty, S. P. Jones, and K. Donnelly. System F with type equality coercions. In Proceedings of the 2007 ACM SIGPLAN international workshop on Types in languages design and implementation, TLDI '07, pages 53--66, New York, NY, USA, 2007. ACM. Google Scholar
Digital Library
- F. van Doorn, H. Geuvers, and F. Wiedijk. Explicit convertibility proofs in pure type systems. Draft paper, in submission, http://www.cs.ru.nl/ herman/PUBS/ExplicitPTS.pdf, 2013.Google Scholar
- D. Vytiniotis, S. Peyton Jones, and J. P. Magalhaes. Equality proofs and deferred type errors: A compiler pearl. In Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming, ICFP 2012, Copenhagen, Denmark, New York, NY, USA, 2012. ACM. Google Scholar
Digital Library
- S. Weirich, D. Vytiniotis, S. Peyton Jones, and S. Zdancewic. Generative type abstraction and type-level computation (extended version). Technical report, University of Pennsylvania, Nov. 2010.Google Scholar
- S. Weirich, D. Vytiniotis, S. Peyton Jones, and S. Zdancewic. Generative type abstraction and type-level computation. In Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, POPL '11, pages 227--240, New York, NY, USA, 2011. ACM. Google Scholar
Digital Library
- Z. Yang. Encoding types in ML-like languages. In Proceedings of the Third International Conference on Functional Programming (ICFP), pages 289--300, Baltimore, Maryland, USA, 1998. ACM Press. Google Scholar
Digital Library
- B. A. Yorgey, S. Weirich, J. Cretin, S. Peyton Jones, D. Vytiniotis, and J. P. Magalhaes. Giving Haskell a promotion. In Proceedings of the 8th ACM SIGPLAN workshop on Types in Language Design and Implementation, TLDI '12, pages 53--66, New York, NY, USA, 2012. ACM. Google Scholar
Digital Library
Index Terms
System FC with explicit kind equality
Recommendations
System FC with explicit kind equality
ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programmingSystem FC, the core language of the Glasgow Haskell Compiler, is an explicitly-typed variant of System F with first-class type equality proofs called coercions. This extensible proof system forms the foundation for type system extensions such as type ...
Depending on types
ICFP '14Is Haskell a dependently typed programming language? Should it be? GHC's many type-system features, such as Generalized Algebraic Datatypes (GADTs), datatype promotion, multiparameter type classes, and type families, give programmers the ability to ...
Depending on types
ICFP '14: Proceedings of the 19th ACM SIGPLAN international conference on Functional programmingIs Haskell a dependently typed programming language? Should it be? GHC's many type-system features, such as Generalized Algebraic Datatypes (GADTs), datatype promotion, multiparameter type classes, and type families, give programmers the ability to ...







Comments