option
Generated by tinox doc
A generic Option<T> for representing an optional value without needing a zero/null value for T (backed internally by a 0- or 1-element List<T>). some/none construction, isSome/isNone checks, unwrap/unwrapOr, and map/andThen/orElse combinators.
Some none
import tinox.core.option;
class Main
{
fnc main() -> Int32
{
let found: Option<Int64> = Option<Int64>::some(42);
let missing: Option<Int64> = Option<Int64>::none();
println("found.isSome() = " + found.isSome().toString());
println("found.unwrap() = " + found.unwrap().toString());
println("missing.unwrapOr(-1) = " + missing.unwrapOr(-1).toString());
return 0;
}
}