option

An option value represents either an empty value (_) or a value of an inner kind. Use ? on kinds to indicate optionality.

Kind Syntax

<u64?><string?><([u64],bool)?>

Construction

x<u64?>:=123u64y<u64?>:=_

Guarded Unwrap

Use postfix ? on an expression to unwrap through guarded arms. Arms use the same box-drawing guard style as functions/state machines.

foo:=x?
x>3u64 x
x3u64 0u64
* 0u64.

Tuple patterns are supported:

(x2, y2):=(x,y)?
(x, y) (x,y)
* (0u64,0u64).