filter method
Filters the right value with a predicate, converting to Left if false
Implementation
Either<L, R> filter(bool Function(R) predicate, L Function() orElse) {
return switch (this) {
Left() => this,
Right(:final value) => predicate(value) ? this : Left(orElse()),
};
}