Abstract
We report on an extension of Haskell with open type-level functions and equality constraints that unifies earlier work on GADTs, functional dependencies, and associated types. The contribution of the paper is that we identify and characterise the key technical challenge of entailment checking; and we give a novel, decidable, sound, and complete algorithm to solve it, together with some practically-important variants. Our system is implemented in GHC, and is already in active use.
Supplemental Material
Available for Download
Supplemental material for: Type checking with open type functions
- Lennart Augustsson. Cayenne - a language with dependent types. In Proc. of ICFP'98, pages 239--250. ACM Press, 1998. Google Scholar
Digital Library
- Leo Bachmair and Ashish Tiwari. Abstract congruence closure and specializations. In Proc. of CADE'00, volume 1831 of LNCS, pages 64--78. Springer-Verlag, 2000. Google Scholar
Digital Library
- Bernhard Beckert. A completion-based method for mixed universal and rigid e-unification. In Proc. of CADE'94, pages 678--692. Springer-Verlag, 1994. Google Scholar
Digital Library
- Manuel Chakravarty, Gabriele Keller, and Simon Peyton Jones. Associated type synonyms. In Proc. of ICFP '05, pages 241--253, New York, NY, USA, 2005. ACM Press. ISBN 1-59593-064-7. Google Scholar
Digital Library
- Chiyan Chen and Hongwei Xi. Combining programming with theorem proving. In Proc. of ICFP'05, pages 66--77. ACM Press, 2005. Google Scholar
Digital Library
- David A. Plaisted and Andrea Sattler-Klein. Proof lengths for equational completion. Information and Computation, 125(2): 154--170, 1996. Google Scholar
Digital Library
- Iavor S. Diatchki. High-level abstractions for low-level programming. PhD thesis, OGI School of Science & Engineering, May 2007.Google Scholar
- Thom Frühwirth. Theory and practice of Constraint Handling Rules. Journal of Logic Programming, 37(1-3):95--138, 1998.Google Scholar
- Martin Gasbichler, Matthias Neubauer, Michael Sperber, and Peter Thiemann. Functional logic overloading. In Proc. POPL'02, pages 233--244. ACM Press, 2002. Google Scholar
Digital Library
- Louis-Julien Guillemette and Stefan Monnier. One vote for type families in Haskell! In Draft Proc. of TFP'08, pages 53--65, 2008.Google Scholar
- Patricia Johann and Neil Ghani. Foundations for structured programming with GADTs. In Proc ACM Conference on Principles of Programming Languages, pages 297--308. ACM, 2008. Google Scholar
Digital Library
- Mark P. Jones. Type classes with functional dependencies. In Proc. of ESOP 2000, number 1782 in Lecture Notes in Computer Science. Springer-Verlag, 2000. Google Scholar
Digital Library
- Deepak Kapur. Shostak's congruence closure as completion. In Proc. of RTA '97, pages 23--37, London, UK, 1997. Springer- Verlag. Google Scholar
Digital Library
- Sheng Liang, Paul Hudak, and Mark Jones. Monad transformers and modular interpreters. In Proc. of POPL '95, pages 333--343, New York, NY, USA, 1995. ACM. Google Scholar
Digital Library
- Daniel R. Licata and Robert Harper. A formulation of Dependent ML with explicit equality proofs. Technical Report CMU-CS-05-178, Carnegie Mellon University Department of Computer Science, 2005.Google Scholar
- Conor McBride. Epigram: A dependently typed functional programming language. http://www.dur.ac.uk/CARG/epigram/.Google Scholar
- Matthias Neubauer, Peter Thiemann, Martin Gasbichler, and Michael Sperber. A functional notation for functional dependencies. In Proceedings of the 2001 Haskell Workshop, 2001.Google Scholar
- Robert Nieuwenhuis and Albert Oliveras. Proof-producing congruence closure. In Proc. of RTA'05, volume 3467 of LNCS, pages 453--468. Springer-Verlag, 2005. Google Scholar
Digital Library
- Pyotr S. Novikov. On the algorithmic unsolvability of the word problem in group theory. In the Steklov Institute of Mathematics 44, pages 1--143, 1955. (Russian).Google Scholar
- Simon Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich, and Geoffrey Washburn. Simple unification-based type inference for GADTs. In Proc. of ICFP'06, pages 50--61. ACM Press, 2006. Google Scholar
Digital Library
- Tom Schrijvers and Martin Sulzmann. Restoring confluence of functional dependencies via type families. In Draft Proc. of TFP'08, pages 22--36, 2008.Google Scholar
- Tom Schrijvers, Martin Sulzmann, Simon Peyton Jones, and Manuel Chakravarty. Towards open type functions for Haskell. In O. Chitil, editor, Proceedings of the 19th International Symposium on Implemantation and Application of Functional Languages, pages 233--251, 2007.Google Scholar
- Tim Sheard. Languages of the future. In Companion to the 19th annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications. ACM Press, 2004. Google Scholar
Digital Library
- Tim Sheard. Type-level computation using narrowing in Omega. In Proceedings of the Programming Languages meets Program Verification (PLPV 2006), volume 174 of Electronic Notes in Computer Science, pages 105--128, 2006. Google Scholar
Digital Library
- Vincent Simonet and Franc¸ois Pottier. A constraint-based approach to guarded algebraic data types. ACM Transactions on Programming Languages and Systems, 29(1), January 2007. Google Scholar
Digital Library
- Peter J. Stuckey and Martin Sulzmann. A theory of overloading. ACM Transactions on Programming Languages and Systems (TOPLAS), 27(6):1--54, 2005. Google Scholar
Digital Library
- Martin Sulzmann, Jeremy Wazny, and Peter J.Stuckey. A framework for extended algebraic data types. In Proc. of FLOPS'06, volume 3945 of LNCS, pages 47--64. Springer-Verlag, 2006. Google Scholar
Digital Library
- Martin Sulzmann, Manuel Chakravarty, Simon Peyton Jones, and Kevin Donnelly. System F with type equality coercions. In ACM SIGPLAN International Workshop on Types in Language Design and Implementation (TLDI'07). ACM, 2007a. Google Scholar
Digital Library
- Martin Sulzmann, Gregory J. Duck, Simon Peyton Jones, and Peter J. Stuckey. Understanding functional dependencies via constraint handling rules. J. Funct. Program., 17(1):83--129, 2007b. Google Scholar
Digital Library
- Martin Sulzmann, Tom Schrijvers, and Peter Stuckey. Type inference for GADTs via Herbrand constraint abduction. Report CW 507, Department of Computer Science, K.U.Leuven, Leuven, Belgium, January 2008.Google Scholar
- Ashish Tiwari, Leo Bachmair, and Harald Rueß. Rigid -unification revisited. In Proc. of CADE'00, volume 1831 of LNCS. Springer-Verlag, 2000. Google Scholar
Digital Library
- Hongwei Xi, Chiyan Chen, and Gang Chen. Guarded recursive datatype constructors. In Proc. of POPL '03, pages 224--235, New York, NY, USA, 2003. ACM Press. Google Scholar
Digital Library
Index Terms
Type checking with open type functions
Recommendations
Type checking with open type functions
ICFP '08: Proceedings of the 13th ACM SIGPLAN international conference on Functional programmingWe report on an extension of Haskell with open type-level functions and equality constraints that unifies earlier work on GADTs, functional dependencies, and associated types. The contribution of the paper is that we identify and characterise the key ...
Type invariants for Haskell
PLPV '09: Proceedings of the 3rd workshop on Programming languages meets program verificationMulti-parameter type classes, functional dependencies, and recently GADTs and open type families open up opportunities to use complex type-level programming to let GHC's type checker verify various properties of your programs. But type-level code is ...
Type checking and typability in domain-free lambda calculi
This paper shows (1) the undecidability of the type checking and the typability problems in the domain-free lambda calculus with negation, product, and existential types, (2) the undecidability of the typability problem in the domain-free polymorphic ...







Comments