filter method
Implementation
Option<T> filter(bool Function(T value) predicate) {
if (this is Some<T>) {
final value = (this as Some<T>).value;
if (predicate(value)) {
return this;
}
}
return None<T>();
}
Option<T> filter(bool Function(T value) predicate) {
if (this is Some<T>) {
final value = (this as Some<T>).value;
if (predicate(value)) {
return this;
}
}
return None<T>();
}