map<U extends Object> method
Maps an Option<T>
to Option<U>
by applying a function to a contained
Some
value. Otherwise returns a None
.
Implementation
Option<U> map<U extends Object>(U Function(T) op) {
final val = toNullable();
if (val != null) {
return Some(op(val));
} else {
return None<U>();
}
}