Electronic Proceedings in Theoretical Computer Science (May 2019)

Extending OCaml's 'open'

  • Runhang Li,
  • Jeremy Yallop

DOI
https://doi.org/10.4204/EPTCS.294.1
Journal volume & issue
Vol. 294, no. Proc. ML 2017
pp. 1 – 14

Abstract

Read online

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.