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).
Supplemental Material
Available for Download
Supplemental material for: HMF: simple type inference for first-class polymorphism
- H. Curry and R. Feys. Combinatory Logic, volume 1. North-Holland, 1958.Google Scholar
- Luis Damas. Type Assignment in Programming Languages. PhD thesis, University of Edinburgh, April 1985. Technical report CST-33-85.Google Scholar
- 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 Scholar
Digital Library
- Atze Dijkstra. Stepping through Haskell. PhD thesis, Universiteit Utrecht, Nov. 2005.Google Scholar
- Jacques Garrigue and Didier Rémy. Semi-explicit first-class polymorphism for ML. Journal of Information and Computation, 155:134--169, 1999. Google Scholar
Digital Library
- 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 Scholar
- Mark P. Jones. First-class polymorphism with type inference. In 24th ACM Symposium on Principles of Programming Languages (POPL'97), January 1997. Google Scholar
Digital Library
- Mark P. Jones. Formal properties of the Hindley-Milner type system. Unpublished notes, August 1995.Google Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- Didier Le Botlan and Didier Rémy. Recasting MLF. Research Report 6228, INRIA, Rocquencourt, France, June 2007.Google Scholar
- Daan Leijen. A reference implementation of HMF. Available at http://research.microsoft.com/users/daan/pubs.html, September 2007a.Google Scholar
- 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 Scholar
- Daan Leijen. Flexible types: robust type inference for first-class polymorphism. Technical Report MSR-TR-2008-55, Microsoft Research, March 2008.Google Scholar
Digital Library
- Daan Leijen. A type directed translation from MLF to System F. In The International Conference on Functional Programming (ICFP'07), Oct. 2007c. Google Scholar
Digital Library
- Daan Leijen and Andres Löh. Qualified types for MLF. In The International Conference on Functional Programming (ICFP'05). ACM Press, Sep. 2005. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Robin Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17:248--375, 1978.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- Simon Peyton Jones and Mark Shields. Lexically scoped type variables. Draft, March 2004.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- J. A. Robinson. A machine-oriented logic based on the resolution principle. Journal of the ACM, 12(1):23--41, January 1965. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
Index Terms
HMF: simple type inference for first-class polymorphism
Recommendations
FreezeML: complete and easy type inference for first-class polymorphism
PLDI 2020: Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and ImplementationML is remarkable in providing statically typed polymorphism without the programmer ever having to write any type annotations. The cost of this parsimony is that the programmer is limited to a form of polymorphism in which quantifiers can occur only at ...
HMF: simple type inference for first-class polymorphism
ICFP '08: Proceedings of the 13th ACM SIGPLAN international conference on Functional programmingHMF 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-...
MLF: raising ML to the power of system F
ICFP '03: Proceedings of the eighth ACM SIGPLAN international conference on Functional programmingWe propose a type system MLF that generalizes ML with first-class polymorphism as in System F. Expressions may contain second-order type annotations. Every typable expression admits a principal type, which however depends on type annotations. Principal ...







Comments