Syntax Lookup

Enter some language construct you want to know more about.
This is the open keyword.

open is used to expose all values, types, modules, etc of a module in the current scope. This is useful whenever you want to use a module's functionality without typing out the module name over and over again.

In some cases, open will cause a "shadow warning" due to existing identifiers and types being redefined by an opened module. You can explicitly ignore that warning by using an open! statement instead.

Example

ReScriptJS Output
open Math

// Use _PI and pow_float from the Math module
let area = radius => Constants.pi *. pow(radius, ~exp=2.0)

References