filter method

Either<L, R> filter(
  1. bool predicate(
    1. R r
    ),
  2. L fallback()
)

Implementation

Either<L, R> filter(bool Function(R r) predicate, L Function() fallback) =>
    fold((_) => this, (R r) => predicate(r) ? this : left(fallback()));