handleErrorWith

fun <A, B, C> Either<A, B>.handleErrorWith(f: (A) -> Either<C, B>): Either<C, B>

Binds the given function across Left, that is, Map, or transform, the left value A of this Either into a new Either with a left value of type C. Returns a new Either with either the original right value of type B or the newly transformed left value of type C.

Parameters

f

The function to bind across Left.


inline fun <A, B, D> Ior<A, B>.handleErrorWith(combine: (B, B) -> B, f: (A) -> Ior<D, B>): Ior<D, B>

Binds the given function across Ior.Left.

Parameters

f

The function to bind across Ior.Left.