skip to main content
research-article

HMF: simple type inference for first-class polymorphism

Published:20 September 2008Publication History
Skip Abstract Section

Abstract

HMF is a conservative extension of Hindley-Milner type inference with first-class polymorphism. In contrast to other proposals, HML uses regular System F types and has a simple type inference algorithm that is just a small extension of the usual Damas-Milner algorithm W. Given the relative simplicity and expressive power, we feel that HMF can be an attractive type system in practice. There is a reference implementation of the type system available online together with a technical report containing proofs (Leijen 2007a,b).

Skip Supplemental Material Section

Supplemental Material

Video

References

  1. H. Curry and R. Feys. Combinatory Logic, volume 1. North-Holland, 1958.Google ScholarGoogle Scholar
  2. Luis Damas. Type Assignment in Programming Languages. PhD thesis, University of Edinburgh, April 1985. Technical report CST-33-85.Google ScholarGoogle Scholar
  3. Luis Damas and Robin Milner. Principal type-schemes for functional programs. In 9th ACM symp. on Principles of Programming Languages (POPL'82), pages 207--212, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Atze Dijkstra. Stepping through Haskell. PhD thesis, Universiteit Utrecht, Nov. 2005.Google ScholarGoogle Scholar
  5. 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
  6. J.R. Hindley. The principal type scheme of an object in combinatory logic. Transactions of the American Mathematical Society, 146:29--60, Dec. 1969.Google ScholarGoogle Scholar
  7. Mark P. Jones. First-class polymorphism with type inference. In 24th ACM Symposium on Principles of Programming Languages (POPL'97), January 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Mark P. Jones. Formal properties of the Hindley-Milner type system. Unpublished notes, August 1995.Google ScholarGoogle Scholar
  9. Didier Le Botlan. MLF: Une extension de ML avec polymorphisme de second ordre et instanciation implicite. PhD thesis, INRIA Rocquencourt, May 2004. Also in English.Google ScholarGoogle Scholar
  10. Didier Le Botlan and Didier Rémy. MLF: Raising ML to the power of System-F. In The International Conference on Functional Programming (ICFP'03), pages 27--38, aug 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Didier Le Botlan and Didier Rémy. Recasting MLF. Research Report 6228, INRIA, Rocquencourt, France, June 2007.Google ScholarGoogle Scholar
  12. Daan Leijen. A reference implementation of HMF. Available at http://research.microsoft.com/users/daan/pubs.html, September 2007a.Google ScholarGoogle Scholar
  13. Daan Leijen. HMF: Simple type inference for first-class polymorphism. Technical Report MSR-TR-2007-118, Microsoft Research, September 2007b. Extended version with proofs.Google ScholarGoogle Scholar
  14. Daan Leijen. Flexible types: robust type inference for first-class polymorphism. Technical Report MSR-TR-2008-55, Microsoft Research, March 2008.Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Daan Leijen. A type directed translation from MLF to System F. In The International Conference on Functional Programming (ICFP'07), Oct. 2007c. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Daan Leijen and Andres Löh. Qualified types for MLF. In The International Conference on Functional Programming (ICFP'05). ACM Press, Sep. 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Xavier Leroy and M Mauny. Dynamics in ML. In ACM conference on Functional Programming and Computer Architecture (FPCA'91). Springer-Verlag, 1991. volume 523 of LNCS. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Robin Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17:248--375, 1978.Google ScholarGoogle ScholarCross RefCross Ref
  19. Martin Odersky and Konstantin Läufer. Putting type annotations to work. In 23th ACM symp. on Principles of Programming Languages (POPL'96), pages 54--67, January 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Simon Peyton Jones and Mark Shields. Lexically scoped type variables. Draft, March 2004.Google ScholarGoogle Scholar
  21. Simon Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich, and Mark Shields. Practical type inference for arbitrary-rank types. Journal of Functional Programming, 17(1):1--82, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Benjamin C. Pierce and David N. Turner. Local type inference. In 25th ACM symp. on Principles of Programming Languages (POPL'98), pages 252--265, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Didier Rémy. Simple, partial type-inference for System-F based on type-containment. In The International Conference on Functional Programming (ICFP'05), September 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Didier Rémy and Boris Yakobowski. A graphical presentation of MLF types with a linear-time unification algorithm. In TLDI'07, pages 27--38, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J. A. Robinson. A machine-oriented logic based on the resolution principle. Journal of the ACM, 12(1):23--41, January 1965. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Dimitrios Vytiniotis, Stephanie Weirich, and Simon Peyton Jones. Boxy types: type inference for higher-rank types and impredicativity. In The International Conference on Functional Programming (ICFP'06), September 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Dimitrios Vytiniotis, Stephanie Weirich, and Simon Peyton Jones. FPH : First-class polymorphism for Haskell. In 13th ACM symp. of the International Conference on Functional Programming (ICFP'08), September 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J.B.Wells. Typability and type checking in System-F are equivalent and undecidable. Ann. Pure Appl. Logic, 98(1-3):111--156,1999.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. HMF: simple type inference for first-class polymorphism

    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!