alt method
Return the current Option if it is a Some, otherwise return the result of orElse
.
Used to provide an alternative Option in case the current one is None.
[🍌].alt(() => [🍎]) -> [🍌]
[_].alt(() => [🍎]) -> [🍎]
Implementation
Option<T> alt(Option<T> Function() orElse) =>
this is Some<T> ? this : orElse();