Option

option T = U -> (T -> U) -> U

An option either contains a value or contains nothing. It is represented as a function which takes two parameters. If the option is empty, it returns the first. If the option contains a value, the second parameter is applied as a function to the contained value.

some T -> option T
Wraps the value in an option

none option ?
The empty option.

map option T -> (T -> U) -> option U
Applies a function to the value in the option.

flatten option (option T) -> option T

flatmap option T -> (T -> option U) -> U

unwrap option T -> T
returns the value in the option, or panics if none is found