Companion
Functions
Link copied to clipboard
inline fun <L, R> conditionally( test: Boolean, ifFalse: () -> L, ifTrue: () -> R): Either<L, R>
Content copied to clipboard
Will create an Either from the result of evaluating the first parameter using the functions provided on second and third parameters. Second parameter represents function for creating an Left in case of a false result of evaluation and third parameter will be used to create a Right in case of a true result.
Link copied to clipboard
Link copied to clipboard
inline fun <E, A, B> resolve( f: () -> Either<E, A>, success: (A) -> Either<Throwable, B>, error: (E) -> Either<Throwable, B>, throwable: (throwable: Throwable) -> Either<Throwable, B>, unrecoverableState: (throwable: Throwable) -> Either<Throwable, Unit>): B
Content copied to clipboard
The resolve function can resolve any suspended function that yields an Either into one type of value.