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.
Supplemental Material
Available for Download
Supplemental material for: FPH: first-class polymorphism for Haskell
- 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 Scholar
Digital Library
- 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
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
- Daan Leijen. HMF: simple type inference for first-class polymorphism. In ACM SIGPLAN International Conference on Functional Programming (ICFP'08). ACM, 2008a. Google Scholar
Digital Library
- Daan Leijen. Flexible types: robust type inference for first-class polymorphism. Technical Report MSR-TR-2008-55, Microsoft Research, March 2008b.Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- R Milner. A theory of type polymorphism in programming. JCSS, 13(3), December 1978.Google Scholar
- John C. Mitchell. Polymorphic type inference and containment. Inf. Comput., 76(2-3):211--249, 1988. ISSN 0890-5401. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- JB Wells. Typability and type checking in system F are equivalent and undecidable. Ann. Pure Appl. Logic, 98:111--156, 1999.Google Scholar
Cross Ref
Index Terms
FPH: first-class polymorphism for Haskell
Recommendations
FPH: first-class polymorphism for Haskell
ICFP '08: Proceedings of the 13th ACM SIGPLAN international conference on Functional programmingLanguages 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 ...
Boxy types: inference for higher-rank types and impredicativity
ICFP '06: Proceedings of the eleventh ACM SIGPLAN international conference on Functional programmingLanguages 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 ...
Boxy types: inference for higher-rank types and impredicativity
Proceedings of the 2006 ICFP conferenceLanguages 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 ...







Comments