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

1ML – core and modules united (F-ing first-class modules)

Published: 29 August 2015 Publication History

Abstract

ML is two languages in one: there is the core, with types and expressions, and there are modules, with signatures, structures and functors. Modules form a separate, higher-order functional language on top of the core. There are both practical and technical reasons for this stratification; yet, it creates substantial duplication in syntax and semantics, and it reduces expressiveness. For example, selecting a module cannot be made a dynamic decision. Language extensions allowing modules to be packaged up as first-class values have been proposed and implemented in different variations. However, they remedy expressiveness only to some extent, are syntactically cumbersome, and do not alleviate redundancy. We propose a redesign of ML in which modules are truly first-class values, and core and module layer are unified into one language. In this "1ML", functions, functors, and even type constructors are one and the same construct; likewise, no distinction is made between structures, records, or tuples. Or viewed the other way round, everything is just ("a mode of use of") modules. Yet, 1ML does not require dependent types, and its type structure is expressible in terms of plain System Fω, in a minor variation of our F-ing modules approach. We introduce both an explicitly typed version of 1ML, and an extension with Damas/Milner-style implicit quantification. Type inference for this language is not complete, but, we argue, not substantially worse than for Standard ML. An alternative view is that 1ML is a user-friendly surface syntax for System Fω that allows combining term and type abstraction in a more compositional manner than the bare calculus.

References

[1]
H. Barendregt. Lambda calculi with types. In S. Abramsky, D. Gabbay, and T. Maibaum, editors, Handbook of Logic in Computer Science, vol. 2, chapter 2, pages 117–309. Oxford University Press, 1992.
[2]
S. K. Biswas. Higher-order functors with transparent signatures. In POPL, 1995.
[3]
L. Damas and R. Milner. Principal type-schemes for functional programs. In POPL, 1982.
[4]
D. Dreyer. Understanding and Evolving the ML Module System. PhD thesis, CMU, 2005.
[5]
D. Dreyer and M. Blume. Principal type schemes for modular programs. In ESOP, 2007.
[6]
D. Dreyer, K. Crary, and R. Harper. A type system for higher-order modules. In POPL, 2003.
[7]
J. Garrigue and A. Frisch. First-class modules and composable signatures in Objective Caml 3.12. In ML, 2010.
[8]
J. Garrigue and D. Rémy. Semi-explicit first-class polymorphism for ML. Information and Computation, 155(1-2), 1999.
[9]
R. Harper and M. Lillibridge. A type-theoretic approach to higherorder modules with sharing. In POPL, 1994.
[10]
R. Harper and J. C. Mitchell. On the type structure of Standard ML. In ACM TOPLAS, volume 15(2), 1993.
[11]
R. Harper, J. C. Mitchell, and E. Moggi. Higher-order modules and the phase distinction. In POPL, 1990.
[12]
R. Harper and B. Pierce. Design considerations for ML-style module systems. In B. C. Pierce, editor, Advanced Topics in Types and Programming Languages, chapter 8, pages 293–346. MIT Press, 2005.
[13]
R. Harper and C. Stone. A type-theoretic interpretation of Standard ML. In Proof, Language, and Interaction: Essays in Honor of Robin Milner. MIT Press, 2000.
[14]
D. Le Botlan and D. Rémy. MLF: Raising ML to the power of System F. In ICFP, 2003.
[15]
X. Leroy. Applicative functors and fully transparent higher-order modules. In POPL, 1995.
[16]
M. Lillibridge. Translucent Sums: A Foundation for Higher-Order Module Systems. PhD thesis, CMU, 1997.
[17]
D. MacQueen. Using dependent types to express modular structure. In POPL, 1986.
[18]
R. Milner. A theory of type polymorphism in programming languages. JCSS, 17:348–375, 1978.
[19]
R. Milner, M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997.
[20]
J. C. Mitchell and G. D. Plotkin. Abstract types have existential type. ACM TOPLAS, 10(3):470–502, July 1988.
[21]
D. Rémy. Records and variants as a natural extension of ML. In POPL, 1989.
[22]
A. Rossberg. The Missing Link – Dynamic components for ML. In ICFP, 2006.
[23]
A. Rossberg. 1ML – Core and modules united (Technical Appendix), 2015. mpi-sws.org/˜rossberg/1ml/.
[24]
A. Rossberg and D. Dreyer. Mixin’ up the ML module system. ACM TOPLAS, 35(1), 2013.
[25]
A. Rossberg, C. Russo, and D. Dreyer. F-ing modules. JFP, 24(5):529–607, 2014.
[26]
C. Russo. Non-dependent types for Standard ML modules. In PPDP, 1999.
[27]
C. Russo. First-class structures for Standard ML. Nordic Journal of Computing, 7(4):348–374, 2000.
[28]
C. Russo. Types for Modules. ENTCS, 60, 2003.
[29]
C. Russo and D. Vytiniotis. QML: Explicit first-class polymorphism for ML. In ML, 2009.
[30]
Z. Shao. Transparent modules with fully syntactic signatures. In ICFP, 1999.
[31]
C. A. Stone and R. Harper. Extensional equivalence and singleton types. ACM TOCL, 7(4):676–722, 2006.
[32]
J.-P. Talpin and P. Jouvelot. Polymorphic type, region and effect inference. JFP, 2(3):245271, 1992.
[33]
D. Vytiniotis, S. Weirich, and S. Peyton Jones. FPH: First-class polymorphism for Haskell. In ICFP, 2008.
[34]
P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad hoc. In POPL, 1989.
[35]
A. Wright. Simple imperative polymorphism. LASC,8:343–356, 1995.

Cited By

View all
  • (2025)A Preliminary Type- and Control-Flow Analysis for System F$$_\omega $$Trends in Functional Programming10.1007/978-3-031-74558-4_8(160-194)Online publication date: 10-Jan-2025
  • (2021)An existential crisis resolved: type inference for first-class existential typesProceedings of the ACM on Programming Languages10.1145/34735695:ICFP(1-29)Online publication date: 19-Aug-2021
  • (2020)The simple essence of algebraic subtyping: principal type inference with subtyping made easy (functional pearl)Proceedings of the ACM on Programming Languages10.1145/34090064:ICFP(1-28)Online publication date: 3-Aug-2020
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICFP 2015: Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming
August 2015
436 pages
ISBN:9781450336697
DOI:10.1145/2784731
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 50, Issue 9
    ICFP '15
    September 2015
    436 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2858949
    • Editor:
    • Andy Gill
    Issue’s Table of Contents
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 the author(s) 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: 29 August 2015

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. ML modules
  2. System F
  3. abstract data types
  4. elaboration
  5. existential types
  6. first-class modules
  7. type systems

Qualifiers

  • Research-article

Conference

ICFP'15
Sponsor:

Acceptance Rates

Overall Acceptance Rate 333 of 1,064 submissions, 31%

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)233
  • Downloads (Last 6 weeks)53
Reflects downloads up to 03 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2025)A Preliminary Type- and Control-Flow Analysis for System F$$_\omega $$Trends in Functional Programming10.1007/978-3-031-74558-4_8(160-194)Online publication date: 10-Jan-2025
  • (2021)An existential crisis resolved: type inference for first-class existential typesProceedings of the ACM on Programming Languages10.1145/34735695:ICFP(1-29)Online publication date: 19-Aug-2021
  • (2020)The simple essence of algebraic subtyping: principal type inference with subtyping made easy (functional pearl)Proceedings of the ACM on Programming Languages10.1145/34090064:ICFP(1-28)Online publication date: 3-Aug-2020
  • (2019)Codata in ActionProgramming Languages and Systems10.1007/978-3-030-17184-1_5(119-146)Online publication date: 6-Apr-2019
  • (2017)Type soundness proofs with definitional interpretersACM SIGPLAN Notices10.1145/3093333.300986652:1(666-679)Online publication date: 1-Jan-2017
  • (2017)Type soundness proofs with definitional interpretersProceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages10.1145/3009837.3009866(666-679)Online publication date: 1-Jan-2017
  • (2016)Type soundness for dependent object types (DOT)ACM SIGPLAN Notices10.1145/3022671.298400851:10(624-641)Online publication date: 19-Oct-2016
  • (2016)Type soundness for dependent object types (DOT)Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications10.1145/2983990.2984008(624-641)Online publication date: 19-Oct-2016
  • (2016)Staging beyond terms: prospects and challengesProceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation10.1145/2847538.2847548(103-108)Online publication date: 11-Jan-2016
  • (2016)1ML with Special EffectsA List of Successes That Can Change the World10.1007/978-3-319-30936-1_18(336-355)Online publication date: 25-Mar-2016
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media