arrow-streams / arrow.streams.internal / recoverWith

recoverWith

fun <R> Result<R>.recoverWith(f: (Throwable) -> Result<R>): Result<R>

Applies the given function f if this is a FreeC.Fail, otherwise returns itself. This is like flatMap for the error-side.