8.4 Local opens for patterns

(Introduced in OCaml 4.04)

pattern::=
module-path .( pattern )
module-path .[ pattern ]
module-path .[| pattern |]
module-path .{ pattern }

For patterns, local opens are limited to themodule-path.( pattern) construction. Thisconstruction locally open the module referred to by the module pathmodule-path in the scope of the pattern pattern.

When the body of a local open pattern is delimited by[], [||], or {}, the parentheses can be omitted.For example, module-path.[ pattern] is equivalent tomodule-path.([ pattern]), and module-path.[| pattern|] isequivalent to module-path.([| pattern|]).