# Extending OCaml's 'open'

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

arXiv: 1905.06543 · 2019-05-17

## TL;DR

This paper introduces an extension to OCaml's 'open' construct, allowing it to accept arbitrary module expressions, which simplifies scope management and enhances flexibility in OCaml programming.

## Contribution

It extends OCaml's 'open' to accept module expressions, addressing scope issues and improving code succinctness.

## Key findings

- Enables more flexible module opening in OCaml.
- Reduces scope-related programming difficulties.
- Simplifies code structure with extended 'open' syntax.

## Abstract

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.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1905.06543/full.md

## Figures

3 figures with captions in the complete paper: https://tomesphere.com/paper/1905.06543/full.md

## References

19 references — full list in the complete paper: https://tomesphere.com/paper/1905.06543/full.md

---
Source: https://tomesphere.com/paper/1905.06543