sealed class Out<E, out A>
Outcome of business function.
It is ~ Future<Either<E,A>> (in vavr style0 the reason for not using vavr here was:
flatMap |
abstract fun <B> flatMap(f: (A) -> Out<E, B>): Out<E, B> |
handle |
fun <E1, B> handle(fe: (E) -> Out<E1, B>, fa: (A) -> B): Out<E1, B> |
map |
abstract fun <B> map(f: (A) -> B): Out<E, B> |
mapLeft |
abstract fun <E1> mapLeft(f: (E) -> E1): Out<E1, A> |
toFuture |
abstract fun toFuture(): Future<out Either<E, out A>> |
fromFuture |
fun <E, A> fromFuture(future: Future<Either<E, A>>): Out<E, A> |
left |
fun <E, A> left(e: E): Out<E, A> |
right |
fun <E, A> right(a: A): Out<E, A>fun <E, A> right(future: Future<A>): Out<E, A> |
get |
fun <E, A> Out<E, A>.get(): A |
getAny |
fun <E, A> Out<E, A>.getAny(): Either<E, A> |
getLeft |
fun <E, A> Out<E, A>.getLeft(): E |