skip to main content
article

Boxy types: inference for higher-rank types and impredicativity

Published:16 September 2006Publication History
Skip Abstract Section

Abstract

Languages with rich type systems are beginning to employ a blend of type inference and type checking, so that the type inference engine is guided by programmer-supplied type annotations. In this paper we show, for the first time, how to combine the virtues of two well-established ideas: unification-based inference, and bidi-rectional propagation of type annotations. The result is a type system that conservatively extends Hindley-Milner, and yet supports both higher-rank types and impredicativity.

References

  1. Shail Aditya and Rishiyur S. Nikhil. Incremental polymorphism. In Functional Programming Languages and Computer Architecture, pages 379--405, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Luis Damas and Robin Milner. Principal type-schemes for functional programs. In Conference Record of the 9th Annual ACM Symposium on Principles of Programming Languages, pages 207--12, New York, 1982. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Jacques Garrigue and Didier Rémy. Semi-explicit first-class polymorphism for ML. Journal of Information and Computation, 155:134--169, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Haruo Hosoya and Benjamin C. Pierce. How good is local type inference? Technical Report MS-CIS-99-17, University of Pennsylvania, June 1999.Google ScholarGoogle Scholar
  5. ACM SIGPLAN International Conference on Functional Programming (ICFP'05), Tallinn, Estonia, September 2005. ACM.Google ScholarGoogle Scholar
  6. Mark P. Jones. First-class polymorphism with type inference. In POPL'97: The 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 483--496, Paris, France, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. AJ Kfoury and JB Wells. A direct algorithm for type inference in the rank-2 fragment of the second-order lambda calculus. In ACM Symposium on Lisp and Functional Programming, pages 196--207. ACM, Orlando, Florida, June 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Ralf Lämmel and Simon Peyton Jones. Scrap your boilerplate: a practical approach to generic programming. In ACM SIGPLAN International Workshop on Types in Language Design and Implementation (TLDI'03), pages 26--37, New Orleans, January 2003. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. D Le Botlan and D Rémy. MLF: raising ML to the power of System F. In ACM SIGPLAN International Conference on Functional Programming (ICFP'03), pages 27--38, Uppsala, Sweden, September 2003. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Oukseh Lee and Kwangkeun Yi. Proofs about a folklore let-polymorphic type inference algorithm. ACM Transactions on Programming Languages and Systems, 20(4):707--723, July 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Daan Leijen and Andres Lh. Qualified types for MLF. In ICFP05 {5}, pages 144--155. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. X Leroy and M Mauny. Dynamics in ML. In RJM Hughes, editor, ACM Conference on Functional Programming and Computer Architecture (FPCA'91), volume 523 of Lecture Notes in Computer Science, Boston, 1991. Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. R Milner. A theory of type polymorphism in programming. JCSS, 13(3), December 1978.Google ScholarGoogle Scholar
  14. JC Mitchell. Coercion and type inference. In ACM POPL, pages 175--185. January 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M Odersky and K Läufer. Putting type annotations to work. In 23rd ACM Symposium on Principles of Programming Languages (POPL'96), pages 54--67. ACM, St Petersburg Beach, Florida, January 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Martin Odersky, Matthias Zenger, and Christoph Zenger. Colored local type inference. In 28th ACM Symposium on Principles of Programming Languages (POPL'01), London, January 2001. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. N Perry. The implementation of practical functional programming languages. Ph. D. thesis, Imperial College, London, 1991.Google ScholarGoogle Scholar
  18. Simon Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich, and Geoffrey Washburn. Simple unification-based type inference for GADTs. In ACM SIGPLAN International Conference on Functional Programming (ICFP'06), Portland, Oregon, 2006. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Benjamin C. Pierce and David N. Turner. Local type inference. In 25th ACM Symposium on Principles of Programming Languages (POPL'98), pages 252--265, San Diego, January 1998. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. François Pottier and Didier Rémy. The essence of ML type inference. In Benjamin C. Pierce, editor, Advanced Topics in Types and Programming Languages, chapter 10, pages 389--489. MIT Press, 2005.Google ScholarGoogle Scholar
  21. Didier Rémy. Simple, partial type inference for System F, based on type containment. In ICFP05 {5}, pages 130--143.Google ScholarGoogle Scholar
  22. Ken Shan. Sexy types in action. SIGPLAN Notices, 39(5):15--22, May 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Mark Shields and Simon Peyton Jones. Lexically scoped type variables. Microsoft Research, 2002.Google ScholarGoogle Scholar
  24. D Tarditi, G Morrisett, P Cheng, C Stone, R Harper, and P Lee. TIL: A type-directed optimizing compiler for ML. In ACM Conference on Programming Languages Design and Implementation (PLDI'96), pages 181--192. ACM, Philadelphia, May 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J Tiuryn and P Urzyczyn. The subtyping problem for second order types is undecidable. In Proc IEEE Symposium on Logic in Computer Science (LICS'96), pages 74--85, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Dimitrios Vytiniotis, Stephanie Weirich, and Simon Peyton Jones. Boxy type inference for higher-rank types and impredicativity, Technical Appendix. Technical Report MS-CIS-05-23, University of Pennsylvania, April 2006.Google ScholarGoogle Scholar

Index Terms

  1. Boxy types: inference for higher-rank types and impredicativity

      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 41, Issue 9
        Proceedings of the 2006 ICFP conference
        September 2006
        296 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1160074
        Issue’s Table of Contents
        • cover image ACM Conferences
          ICFP '06: Proceedings of the eleventh ACM SIGPLAN international conference on Functional programming
          September 2006
          308 pages
          ISBN:1595933093
          DOI:10.1145/1159803
          • General Chair:
          • John Reppy,
          • Program Chair:
          • Julia Lawall

        Copyright © 2006 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 16 September 2006

        Check for updates

        Qualifiers

        • 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!