sealed class Either<out T : Any, out U : Any>
| Left |
class Left<out T : Any> : Either<T, Nothing> |
| Right |
class Right<out U : Any> : Either<Nothing, U> |
| left |
abstract val left: T? |
| right |
abstract val right: U? |
| component1 |
operator fun component1(): T? |
| component2 |
operator fun component2(): U? |
| fold |
fun fold(leftFn: (T) -> Unit, rightFn: (U) -> Unit): Either<T, U> |
| ifLeft |
fun ifLeft(leftFn: (T) -> Unit): Either<T, U> |
| ifRight |
fun ifRight(rightFn: (U) -> Unit): Either<T, U> |
| swap |
fun swap(): Either<U, T> |
| flattenLeft |
fun <T : Any, U : Any> Either<Either<T, U>, U>.flattenLeft(): Either<T, U> |
| flattenRight |
fun <T : Any, U : Any> Either<T, Either<T, U>>.flattenRight(): Either<T, U> |
| Left |
class Left<out T : Any> : Either<T, Nothing> |
| Right |
class Right<out U : Any> : Either<Nothing, U> |