Skip to main content

Advertisement

SpringerLink
Log in
Menu
Find a journal Publish with us Track your research
Search
Cart
Book cover

European Symposium on Programming

ESOP 2007: Programming Languages and Systems pp 441–457Cite as

  1. Home
  2. Programming Languages and Systems
  3. Conference paper
Principal Type Schemes for Modular Programs

Principal Type Schemes for Modular Programs

  • Derek Dreyer1 &
  • Matthias Blume1 
  • Conference paper
  • 949 Accesses

  • 5 Citations

  • 1 Altmetric

Part of the Lecture Notes in Computer Science book series (LNTCS,volume 4421)

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 \(\mathcal{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.

Keywords

  • Type System
  • Module Language
  • Type Inference
  • Abstract Type
  • Typing Judgment

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Chapter PDF

Download to read the full chapter text

References

  1. Damas, L., Milner, R.: Principal type schemes for functional programs. In: POPL ’82 (1982)

    Google Scholar 

  2. Dreyer, D.: Recursive type generativity. To appear in Journal of Functional Programming. Original version appeared in ICFP ’05.

    Google Scholar 

  3. Dreyer, D.: Practical type theory for recursive modules. Technical Report TR-2006-07, University of Chicago, Department of Computer Science (August 2006)

    Google Scholar 

  4. Dreyer, D., Blume, M.: Principal type schemes for modular programs. Technical Report TR-2007-02, Univ. of Chicago Comp. Sci. Dept. (January 2007)

    Google Scholar 

  5. Dreyer, D., Harper, R., Chakravarty, M.M.T.: Modular type classes. In: POPL ’07 (2007)

    Google Scholar 

  6. Harper, R., Lillibridge, M.: A type-theoretic approach to higher-order modules with sharing. In: POPL ’94 (1994)

    Google Scholar 

  7. Harper, R., Stone, C.: A type-theoretic interpretation of Standard ML. In: Plotkin, G., Stirling, C., Tofte, M. (eds.) Proof, Language, and Interaction: Essays in Honor of Robin Milner, MIT Press, Cambridge (2000)

    Google Scholar 

  8. Kahrs, S., Sannella, D., Tarlecki, A.: The definition of Extended ML: A gentle introduction. Theoretical Computer Science 173(2), 445–484 (1997)

    CrossRef  MATH  MathSciNet  Google Scholar 

  9. Leroy, X.: Applicative functors and fully transparent higher-order modules. In: POPL 95 (1995)

    Google Scholar 

  10. Leroy, X.: Manifest types, modules, and separate compilation. In: POPL ’94 (1994)

    Google Scholar 

  11. Leroy, X.: Polymorphic Typing of an Algorithmic Language. PhD thesis, Université Paris 7 (1992)

    Google Scholar 

  12. Lillibridge, M.: Translucent Sums: A Foundation for Higher-Order Module Systems. PhD thesis, Carnegie Mellon University (May 1997)

    Google Scholar 

  13. MacQueen, D.: Private communication (2006)

    Google Scholar 

  14. Miller, D.: Unification under a mixed prefix. Journal of Symbolic Computation 14, 321–358 (1992)

    CrossRef  MATH  MathSciNet  Google Scholar 

  15. Milner, R.: A theory of type polymorphism in programming. Journal of Computer and System Sciences 17, 348–375 (1978)

    CrossRef  MATH  MathSciNet  Google Scholar 

  16. Milner, R., et al.: The Definition of Standard ML (Revised). MIT Press, Cambridge (1997)

    Google Scholar 

  17. Mitchell, J.C., Plotkin, G.D.: Abstract types have existential type. Transactions on Programming Languages and Systems 10(3), 470–502 (1988)

    CrossRef  Google Scholar 

  18. Odersky, M.: Putting type annotations to work. In: POPL ’96, pp. 54–67 (1996)

    Google Scholar 

  19. Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)

    Google Scholar 

  20. Russo, C.V.: Types for Modules. PhD thesis, University of Edinburgh (1998)

    Google Scholar 

  21. Russo, C.V.: First-class structures for Standard ML. Nordic Journal of Computing 7(4), 348–374 (2000)

    MATH  MathSciNet  Google Scholar 

  22. Wright, A.K.: Polymorphic references for mere mortals. In: Krieg-Brückner, B. (ed.) ESOP 1992. LNCS, vol. 582, Springer, Heidelberg (1992)

    Google Scholar 

Download references

Author information

Authors and Affiliations

  1. Toyota Technological Institute at Chicago,  

    Derek Dreyer & Matthias Blume

Authors
  1. Derek Dreyer
    View author publications

    You can also search for this author in PubMed Google Scholar

  2. Matthias Blume
    View author publications

    You can also search for this author in PubMed Google Scholar

Editor information

Rocco De Nicola

Rights and permissions

Reprints and Permissions

Copyright information

© 2007 Springer Berlin Heidelberg

About this paper

Cite this paper

Dreyer, D., Blume, M. (2007). Principal Type Schemes for Modular Programs. In: De Nicola, R. (eds) Programming Languages and Systems. ESOP 2007. Lecture Notes in Computer Science, vol 4421. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-71316-6_30

Download citation

  • .RIS
  • .ENW
  • .BIB
  • DOI: https://doi.org/10.1007/978-3-540-71316-6_30

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-71314-2

  • Online ISBN: 978-3-540-71316-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Share this paper

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

Publish with us

Policies and ethics

search

Navigation

  • Find a journal
  • Publish with us
  • Track your research

Discover content

  • Journals A-Z
  • Books A-Z

Publish with us

  • Publish your research
  • Open access publishing

Products and services

  • Our products
  • Librarians
  • Societies
  • Partners and advertisers

Our imprints

  • Springer
  • Nature Portfolio
  • BMC
  • Palgrave Macmillan
  • Apress
  • Your US state privacy rights
  • Accessibility statement
  • Terms and conditions
  • Privacy policy
  • Help and support
  • Cancel contracts here

167.114.118.210

Not affiliated

Springer Nature

© 2023 Springer Nature