skip to main content
research-article

FPH: first-class polymorphism for Haskell

Published:20 September 2008Publication History
Skip Abstract Section

Abstract

Languages supporting polymorphism typically have ad-hoc restrictions on where polymorphic types may occur. Supporting "firstclass" polymorphism, by lifting those restrictions, is obviously desirable, but it is hard to achieve this without sacrificing type inference. We present a new type system for higher-rank and impredicative polymorphism that improves on earlier proposals: it is an extension of Damas-Milner; it relies only on System F types; it has a simple, declarative specification; it is robust to program transformations; and it enjoys a complete and decidable type inference algorithm.

Skip Supplemental Material Section

Supplemental Material

Video

References

  1. 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
  2. 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
  3. 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
  4. 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
  5. Didier Le Botlan. MLF : Une extension de ML avec polymorphisme de second ordre et instanciation implicite. PhD thesis, Ecole Polytechnique, May 2004. 326 pages, also available in english.Google ScholarGoogle Scholar
  6. Didier Le Botlan and Didier Rémy. Recasting MLF. Research Report 6228, INRIA, Rocquencourt, BP 105, 78 153 Le Chesnay Cedex, France, June 2007.Google ScholarGoogle Scholar
  7. Daan Leijen. HMF: simple type inference for first-class polymorphism. In ACM SIGPLAN International Conference on Functional Programming (ICFP'08). ACM, 2008a. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Daan Leijen. Flexible types: robust type inference for first-class polymorphism. Technical Report MSR-TR-2008-55, Microsoft Research, March 2008b.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Daan Leijen. A type directed translation of MLF to System-F. In ACM SIGPLAN International Conference on Functional Programming (ICFP'07), Freiburg, Germany, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Daan Leijen and Andres Löh. Qualified types for MLF. In ACM SIGPLAN International Conference on Functional Programming (ICFP'06), pages 144--155. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. R Milner. A theory of type polymorphism in programming. JCSS, 13(3), December 1978.Google ScholarGoogle Scholar
  12. John C. Mitchell. Polymorphic type inference and containment. Inf. Comput., 76(2-3):211--249, 1988. ISSN 0890-5401. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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
  14. Simon Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich, and Mark Shields. Practical type inference for arbitrary-rank types. J. Funct. Program., 17(1):1--82, 2007. ISSN 0956-7968. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Frank Pfenning. Partial polymorphic type inference and higher-order unification. In LFP '88: Proceedings of the 1988 ACM conference on LISP and functional programming, pages 153--163, New York, NY, USA, 1988. ACM. ISBN 0-89791-273-X. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Didier Rémy. Simple, partial type inference for System F, based on type containment. In ACM SIGPLAN International Conference on Functional Programming (ICFP'05), pages 130--143, Tallinn, Estonia, September 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Dimitrios Vytiniotis. Practical type inference for first-class polymorphism. PhD thesis, University of Pennsylvania, 2008. URL www.cis.upenn.edu/~dimitriv/fph. In submission. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Dimitrios Vytiniotis, Stephanie Weirich, and Simon Peyton Jones. Boxy types: Inference for higher-rank types and impredicativity. In ACM SIGPLAN International Conference on Functional Programming (ICFP'06), Portland, Oregon, 2006. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. JB Wells. Typability and type checking in system F are equivalent and undecidable. Ann. Pure Appl. Logic, 98:111--156, 1999.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. FPH: first-class polymorphism for Haskell

      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!