redeemWith

inline fun <A, B, C, D> Either<A, B>.redeemWith(fa: (A) -> Either<C, D>, fb: (B) -> Either<C, D>): Either<C, D>(source)
inline fun <A, B> Option<A>.redeemWith(fe: (Unit) -> Option<B>, fb: (A) -> Option<B>): Option<B>(source)


inline fun <A, B> Result<A>.redeemWith(handleErrorWith: (throwable: Throwable) -> Result<B>, transform: (value: A) -> Result<B>): Result<B>(source)

Compose both:

Combining the powers of flatMap and handleErrorWith.