EitherExtensions<L, R> extension

Extension methods for working with Either

on

Methods

filter(bool predicate(R), L orElse()) Either<L, R>

Available on Either<L, R>, provided by the EitherExtensions extension

Filters the right value with a predicate, converting to Left if false
toList() List<R>

Available on Either<L, R>, provided by the EitherExtensions extension

Converts this Either to a list, containing the right value or empty for Left
toNullable() → R?

Available on Either<L, R>, provided by the EitherExtensions extension

Converts this Either to a nullable value, returning null for Left