Types & safe values · BUILT-IN MODULE

match

Functional matching helpers.

Quick start

use match
use match
use option

value = option.some 5
answer = match.option value on_some on_none
say answer

API reference

match.value subject pattern handler ... fallback

Match values with handler functions.

比對 values with handler functions.
match.option option some_handler none_handler

Match an Option.

比對 an Option.
match.result result ok_handler error_handler

Match a Result.

比對 a Result.