Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.5555/1762174.1762215guideproceedingsArticle/Chapter ViewAbstractPublication PagesConference Proceedingsacm-pubtype
Article

Principal type schemes for modular programs

Published: 24 March 2007 Publication History

Abstract

Two of the most prominent features of ML are its expressive module system and its support for Damas-Milner type inference. However, while the foundations of both these features have been studied extensively, their interaction has never received a proper type-theoretic treatment. One consequence is that both the official Definition and the alternative Harper-Stone semantics of Standard ML are difficult to implement correctly. To bolster this claim, we offer a series of short example programs on which no existing SML typechecker follows the behavior prescribed by either formal definition. It is unclear how to amend the implementations to match the definitions or vice versa. Instead, we propose a way of defining how type inference interacts with modules that is more liberal than any existing definition or implementation of SML and, moreover, admits a provably sound and complete typechecking algorithm via a straightforward generalization of Algorithm W. In addition to being conceptually simple, our solution exhibits a novel hybrid of the Definition and Harper-Stone semantics of SML, and demonstrates the broader relevance of some type-theoretic techniques developed recently in the study of recursive modules.

References

[1]
Luis Damas and Robin Milner. Principal type schemes for functional programs. In POPL '82.
[2]
Derek Dreyer. Recursive type generativity. To appear in Journal of Functional Programming. Original version appeared in ICFP '05.
[3]
Derek Dreyer. Practical type theory for recursive modules. Technical Report TR- 2006-07, University of Chicago, Department of Computer Science, August 2006.
[4]
Derek Dreyer and Matthias Blume. Principal type schemes for modular programs. Technical Report TR-2007-02, Univ. of Chicago Comp. Sci. Dept., January 2007.
[5]
Derek Dreyer, Robert Harper, and Manuel M. T. Chakravarty. Modular type classes. In POPL '07.
[6]
Robert Harper and Mark Lillibridge. A type-theoretic approach to higher-order modules with sharing. In POPL '94.
[7]
Robert Harper and Chris Stone. A type-theoretic interpretation of Standard ML. In G. Plotkin, C. Stirling, and M. Tofte, editors, Proof, Language, and Interaction: Essays in Honor of Robin Milner. MIT Press, 2000.
[8]
Stefan Kahrs, Donald Sannella, and Andrzej Tarlecki. The definition of Extended ML: A gentle introduction. Theoretical Computer Science, 173(2):445-484, 1997.
[9]
Xavier Leroy. Applicative functors and fully transparent higher-order modules. In POPL 95.
[10]
Xavier Leroy. Manifest types, modules, and separate compilation. In POPL '94.
[11]
Xavier Leroy. Polymorphic Typing of an Algorithmic Language. PhD thesis, Université Paris 7, 1992.
[12]
Mark Lillibridge. Translucent Sums: A Foundation for Higher-Order Module Systems . PhD thesis, Carnegie Mellon University, May 1997.
[13]
David MacQueen, 2006. Private communication.
[14]
Dale Miller. Unification under a mixed prefix. Journal of Symbolic Computation,
[15]
Robin Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17:348-75, 1978.
[16]
Robin Milner, Mads Tofte, Robert Harper, and David MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997.
[17]
John C. Mitchell and Gordon D. Plotkin. Abstract types have existential type. Transactions on Programming Languages and Systems, 10(3):470-502, 1988.
[18]
Martin Odersky and Konstantin Läufer. Putting type annotations to work. In POPL '96, pages 54-67.
[19]
Benjamin C. Pierce. Types and Programming Languages. MIT Press, 2002.
[20]
Claudio V. Russo. Types for Modules. PhD thesis, University of Edinburgh, 1998.
[21]
Claudio V. Russo. First-class structures for Standard ML. Nordic Journal of Computing, 7(4):348-374, 2000.
[22]
Andrew K. Wright. Polymorphic references for mere mortals. In ESOP '92.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Guide Proceedings
ESOP'07: Proceedings of the 16th European Symposium on Programming
March 2007
537 pages
ISBN:9783540713142
  • Editor:
  • Rocco De Nicola

Sponsors

  • Fundacao para a Ciencia e Tecnologia
  • TAP Air Portugal
  • Enabler
  • CISCO

Publisher

Springer-Verlag

Berlin, Heidelberg

Publication History

Published: 24 March 2007

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 04 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2016)Visible Type ApplicationProceedings of the 25th European Symposium on Programming Languages and Systems - Volume 963210.1007/978-3-662-49498-1_10(229-254)Online publication date: 2-Apr-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
  • (2010)F-ing modulesProceedings of the 5th ACM SIGPLAN workshop on Types in language design and implementation10.1145/1708016.1708028(89-102)Online publication date: 23-Jan-2010
  • (2007)A type system for recursive modulesACM SIGPLAN Notices10.1145/1291220.129119642:9(289-302)Online publication date: 1-Oct-2007
  • (2007)A type system for recursive modulesProceedings of the 12th ACM SIGPLAN international conference on Functional programming10.1145/1291151.1291196(289-302)Online publication date: 3-Oct-2007

View Options

View options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media