unwrapOption<T> function
Unwraps the value of an Option, returning its contained value or null.
unwrapOption(some(42)); // 42
unwrapOption(none<int>()); // null
Implementation
T? unwrapOption<T>(Option<T> option) {
return switch (option) {
Some<T>(:final value) => value,
None<T>() => null,
};
}