Either

sealed class Either<out A, out B>

Types

Left
Link copied to clipboard
common
data class Left<out A, Nothing>(value: A) : Either<A, Nothing>
Right
Link copied to clipboard
common
data class Right<Nothing, out B>(value: B) : Either<Nothing, B>

Functions

fold
Link copied to clipboard
common
fun <X> fold(fa: (A) -> X, fb: (B) -> X): X
transform
Link copied to clipboard
common
fun <X, Y> transform(fa: (A) -> X, fb: (B) -> Y): Either<X, Y>

Properties

isLeft
Link copied to clipboard
common
abstract val isLeft: Boolean
isRight
Link copied to clipboard
common
abstract val isRight: Boolean
left
Link copied to clipboard
common
abstract val left: A?
right
Link copied to clipboard
common
abstract val right: B?

Inheritors

Either
Link copied to clipboard
Either
Link copied to clipboard

Extensions

flatMap
Link copied to clipboard
common
fun <L, R, T> Either<L, R>.flatMap(f: (R) -> Either<L, T>): Either<L, T>
map
Link copied to clipboard
common
fun <L, R, T> Either<L, R>.map(f: (R) -> T): Either<L, T>