Guard patterns

Aguard patternhas the formp | gwherepis a pattern andgis a Boolean expression that may reference any variables bound inp.The pattern matches ifpmatches andgevaluates totrue.

For example, the following expression evaluates to6:

match 1 + 2 with
x
| x == 4     -> 0
| x + 1 == 4 -> 6
_              -> 42