skip to main content
research-article

Type checking with open type functions

Published:20 September 2008Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

Video

References

  1. Lennart Augustsson. Cayenne - a language with dependent types. In Proc. of ICFP'98, pages 239--250. ACM Press, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. Chiyan Chen and Hongwei Xi. Combining programming with theorem proving. In Proc. of ICFP'05, pages 66--77. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. David A. Plaisted and Andrea Sattler-Klein. Proof lengths for equational completion. Information and Computation, 125(2): 154--170, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Iavor S. Diatchki. High-level abstractions for low-level programming. PhD thesis, OGI School of Science & Engineering, May 2007.Google ScholarGoogle Scholar
  8. Thom Frühwirth. Theory and practice of Constraint Handling Rules. Journal of Logic Programming, 37(1-3):95--138, 1998.Google ScholarGoogle Scholar
  9. Martin Gasbichler, Matthias Neubauer, Michael Sperber, and Peter Thiemann. Functional logic overloading. In Proc. POPL'02, pages 233--244. ACM Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Louis-Julien Guillemette and Stefan Monnier. One vote for type families in Haskell! In Draft Proc. of TFP'08, pages 53--65, 2008.Google ScholarGoogle Scholar
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. Deepak Kapur. Shostak's congruence closure as completion. In Proc. of RTA '97, pages 23--37, London, UK, 1997. Springer- Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle Scholar
  16. Conor McBride. Epigram: A dependently typed functional programming language. http://www.dur.ac.uk/CARG/epigram/.Google ScholarGoogle Scholar
  17. Matthias Neubauer, Peter Thiemann, Martin Gasbichler, and Michael Sperber. A functional notation for functional dependencies. In Proceedings of the 2001 Haskell Workshop, 2001.Google ScholarGoogle Scholar
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle Scholar
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. Tom Schrijvers and Martin Sulzmann. Restoring confluence of functional dependencies via type families. In Draft Proc. of TFP'08, pages 22--36, 2008.Google ScholarGoogle Scholar
  22. 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 ScholarGoogle Scholar
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. Peter J. Stuckey and Martin Sulzmann. A theory of overloading. ACM Transactions on Programming Languages and Systems (TOPLAS), 27(6):1--54, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. 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 ScholarGoogle Scholar
  31. Ashish Tiwari, Leo Bachmair, and Harald Rueß. Rigid -unification revisited. In Proc. of CADE'00, volume 1831 of LNCS. Springer-Verlag, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Type checking with open type functions

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 43, Issue 9
        ICFP '08
        September 2008
        399 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1411203
        Issue’s Table of Contents
        • cover image ACM Conferences
          ICFP '08: Proceedings of the 13th ACM SIGPLAN international conference on Functional programming
          September 2008
          422 pages
          ISBN:9781595939197
          DOI:10.1145/1411204

        Copyright © 2008 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 20 September 2008

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!