redeemWith

inline fun <A, B> Option<A>.redeemWith(fe: (Unit) -> Option<B>, fb: (A) -> Option<B>): Option<B>


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

Compose both:

Combining the powers of flatMap and handleErrorWith.


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

Deprecated

This API is niche and will be removed in the future. If this method is crucial for you, please let us know on the Arrow Github. Thanks! https://github.com/arrow-kt/arrow/issues Prefer using the Either DSL, and recover

Replace with

fold(fa, fb)