resolve

inline fun <E, A, B> resolve(f: () -> Either<E, A>, success: (a: A) -> Either<Throwable, B>, error: (e: E) -> Either<Throwable, B>, throwable: (throwable: Throwable) -> Either<Throwable, B>, unrecoverableState: (throwable: Throwable) -> Either<Throwable, Unit>): B

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 recover, catch and the either DSL to work with errors

The resolve function can resolve any function that yields an Either into one type of value.

Return

the result of applying the resolve function.

Parameters

f

the function that needs to be resolved.

success

the function to apply if f yields a success of type A.

error

the function to apply if f yields an error of type E.

throwable

the function to apply if f throws a Throwable. Throwing any Throwable in the throwable function will render the resolve function nondeterministic.

unrecoverableState

the function to apply if resolve is in an unrecoverable state.