Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1596627.1596630acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

QML: explicit first-class polymorphism for ML

Published: 30 August 2009 Publication History

Abstract

Recent years have seen a revival of interest in extending ML's predicative type inference system with impredicative quantification in the style of System F, for which type inference is undecidable. This paper suggests a modest extension of ML with System F types: the heart of the idea is to extend the language of types with unary universal and existential quantifiers. The introduction and elimination of a quantified type is never inferred but indicated explicitly by the programmer by supplying the quantified type itself. Quantified types co-exist with ordinary ML schemes, which are in turn implicitly introduced and eliminated at let-bindings and use sites, respectively. The resulting language, QML, does not impose any restriction on instantiating quantified variables with quantified types; neither let- nor λ-bound variables ever require a type annotation, even if the variable's inferred scheme or type involves quantified types. This proposal, albeit more verbose in terms of annotations than others, is simple to specify, implement, understand, and formalize.

References

[1]
B. Aydemir, A. Charguéraud, B. C. Pierce, R. Pollack, and S. Weirich. Engineering formal metatheory. In POPL'08, pages 3--15, ACM, 2008.
[2]
The Coq proof assistant. http://coq.inria.fr.
[3]
L. Damas and R. Milner. Principal type-schemes for functional programs. In POPL'82, pages 207--12, ACM, 1982.
[4]
J. Garrigue and D. Rémy. Semi-explicit first-class polymorphism for ML. Journal of Information and Computation, 155:134--169, 1999.
[5]
J. R. Hindley. The principal type-scheme of an object in combinatory logic. (146):29--60, 1969.
[6]
M. P. Jones. First-class polymorphism with type inference. In POPL'97, pages 483--496, ACM, 1997.
[7]
A. J. Kfoury and J. B. 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.
[8]
N. R. Krishnaswami. Focusing on pattern matching. In POPL '09, pages 366--378, ACM, 2009.
[9]
D. Le Botlan and D. Rémy. MLF: raising ML to the power of System F. In ICFP'03, pages 27--38, ACM, 2003.
[10]
D. Leijen. HMF: simple type inference for first-class polymorphism. In ICFP'08. ACM, 2008.
[11]
D. Leijen. Flexible types: robust type inference for first-class polymorphism. In POPL '09, pages 66--77, ACM, 2009.
[12]
K. LŁaufer and M. Odersky. Polymorphic type inference and abstract data types. ACM Transactions on Programming Languages and Systems, 16(5):1411--1430, 1994.
[13]
D. Miller. Unification under a mixed prefix. J. Symb. Comput., 14(4):321--358, 1992.
[14]
R. Milner, M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997.
[15]
M. Odersky and K. Laufer. Putting type annotations to work. In POPL'96, pages 54--67, ACM, 1996.
[16]
J. O'Toole and D. Gifford. Type reconstruction with first-class polymorphic values. In PLDI'89, pages 207--217, 1989. Published as SIGPLAN Notices, volume 27, number 7.
[17]
L. Paulson. ML for the working programmer. Cambridge University Press, 1991.
[18]
S. Peyton Jones, D. Vytiniotis, S. Weirich, and M. Shields. Practical type inference for arbitrary-rank types. J. Funct. Program., 17(1):1--82, 2007.
[19]
F. Pfenning. Partial polymorphic type inference and higher-order unification. In LFP '88, pages 153--163, ACM, 1988.
[20]
D. Rémy. Programming objects with ML-ART: An extension to ML with abstract and record types. In M. Hagiya and J. C. Mitchell, editors, International Symposium on Theoretical Aspects of Computer Software, number 789 in LNCS, pages 321--346, Springer, 1994.
[21]
D. Rémy. Simple, partial type inference for System F, based on type containment. In ICFP'05, pages 130--143, ACM, 2005.
[22]
C. V. Russo. First-class Structures for Standard ML. Nordic Journal Of Computing, 7:348--374, January 2000.
[23]
D. Vytiniotis, S. Weirich, and S. Peyton Jones. Boxy types: Inference for higher-rank types and impredicativity. In ICFP'06, ACM, 2006.
[24]
D. Vytiniotis, S. Weirich, and S. Peyton Jones. FPH: first-class polymorphism for Haskell. In ICFP'08, ACM, 2008.
[25]
J. B. Wells. Typability and type checking in system F are equivalent and undecidable. Ann. Pure Appl. Logic, 98:111--156, 1999.

Cited By

View all
  • (2020)A quick look at impredicativityProceedings of the ACM on Programming Languages10.1145/34089714:ICFP(1-29)Online publication date: 3-Aug-2020
  • (2018)Guarded impredicative polymorphismACM SIGPLAN Notices10.1145/3296979.319238953:4(783-796)Online publication date: 11-Jun-2018
  • (2018)Guarded impredicative polymorphismProceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3192366.3192389(783-796)Online publication date: 11-Jun-2018
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ML '09: Proceedings of the 2009 ACM SIGPLAN workshop on ML
August 2009
76 pages
ISBN:9781605585093
DOI:10.1145/1596627
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 30 August 2009

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. impredicativity
  2. polymorphism
  3. type inference

Qualifiers

  • Research-article

Conference

ICFP '09
Sponsor:

Acceptance Rates

ML '09 Paper Acceptance Rate 6 of 11 submissions, 55%;
Overall Acceptance Rate 6 of 11 submissions, 55%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 16 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2020)A quick look at impredicativityProceedings of the ACM on Programming Languages10.1145/34089714:ICFP(1-29)Online publication date: 3-Aug-2020
  • (2018)Guarded impredicative polymorphismACM SIGPLAN Notices10.1145/3296979.319238953:4(783-796)Online publication date: 11-Jun-2018
  • (2018)Guarded impredicative polymorphismProceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3192366.3192389(783-796)Online publication date: 11-Jun-2018
  • (2018)1ML – Core and modules unitedJournal of Functional Programming10.1017/S095679681800020528Online publication date: 27-Dec-2018
  • (2016)Executable Relational Specifications of Polymorphic Type Systems Using PrologFunctional and Logic Programming10.1007/978-3-319-29604-3_8(109-125)Online publication date: 21-Feb-2016
  • (2015)1ML – core and modules united (F-ing first-class modules)ACM SIGPLAN Notices10.1145/2858949.278473850:9(35-47)Online publication date: 29-Aug-2015
  • (2015)1ML – core and modules united (F-ing first-class modules)Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming10.1145/2784731.2784738(35-47)Online publication date: 29-Aug-2015
  • (2012)Embedding FProceedings of the 8th ACM SIGPLAN workshop on Generic programming10.1145/2364394.2364402(45-56)Online publication date: 12-Sep-2012
  • (2011)The Locally Nameless RepresentationJournal of Automated Reasoning10.1007/s10817-011-9225-249:3(363-408)Online publication date: 6-May-2011

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media