sealed class Either<out L, out R>
abstract fun isLeft(): Boolean |
|
abstract fun isRight(): Boolean |
infix fun <L, R, O> Either<L, (R) -> O>.apply(f: Either<L, R>): Either<L, O> |
|
infix fun <L, R, O> Either<L, R>.flatMap(f: (R) -> Either<L, O>): Either<L, O> |
|
fun <L, R, O> Either<L, R>.fold(lf: (L) -> O, rf: (R) -> O): O |
|
infix fun <L, R, O> Either<L, R>.map(f: (R) -> O): Either<L, O> |
|
infix fun <L, R, O> Either<L, O>.mapLeft(f: (L) -> R): Either<R, O> |
data class Left<out L> : Either<L, Nothing> |
|
data class Right<out T> : Either<Nothing, T> |