redeem With
inline fun <A, B> Result<A>.redeemWith(handleErrorWith: (throwable: Throwable) -> Result<B>, transform: (value: A) -> Result<B>): Result<B>
Compose both:
a transform operation on the success value A into B whilst flattening Result.
a recovering transform operation on the failure value Throwable whilst flattening Result.
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 a simple fold, or when expression
Replace with
fold(fa, fb)Content copied to clipboard