Extending OCaml's 'open'

Runhang Li
(Twitter, Inc)
Jeremy Yallop
(University of Cambridge)

We propose a harmonious extension of OCaml's 'open' construct.

OCaml's existing construct 'open M' imports the names exported by the module 'M' into the current scope. At present 'M' is required to be the path to a module. We propose extending 'open' to instead accept an arbitrary module expression, making it possible to succinctly address a number of existing scope-related difficulties that arise when writing OCaml programs.

In Sam Lindley and Gabriel Scherer: Proceedings ML Family / OCaml Users and Developers workshops (ML 2017), Oxford, UK, 7th September 2017, Electronic Proceedings in Theoretical Computer Science 294, pp. 1–14.
Published: 16th May 2019.

ArXived at: https://dx.doi.org/10.4204/EPTCS.294.1 bibtex PDF
References in reconstructed bibtex, XML and HTML format (approximated).
Comments and questions to: eptcs@eptcs.org
For website issues: webmaster@eptcs.org