Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Add a "with" syntax for patterns

Leo White edited this page Sep 8, 2013 · 13 revisions

Add a "with" syntax for patterns

  • Expertise: ★★★★☆
  • Time: ★★★★☆
  • Mantis: None
  • Mentor: Jeremy/Leo
  • Who is working on this: ???
  • What needs to be done: Add the following construct
match x with
  Foo(y, z)
| Bar y with z = 3 -> y + z

The with z = 3 binds z to 3 if the Bar clause in the or-pattern matches.

See the ocaml-patterns documentation for a more detailed semantics.