Previous Up Next

8.5  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 the module-path.( pattern) construction. This construction locally open the module referred to by the module path module-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 to module-path.([ pattern]), and module-path.[|  pattern |] is equivalent to module-path.([|  pattern |]).


Previous Up Next