common / com.schibsted.account.common.lib / Either

Either

sealed class Either<out L, out R>

Functions

isLeft

abstract fun isLeft(): Boolean

isRight

abstract fun isRight(): Boolean

Extension Functions

apply

infix fun <L, R, O> Either<L, (R) -> O>.apply(f: Either<L, R>): Either<L, O>

flatMap

infix fun <L, R, O> Either<L, R>.flatMap(f: (R) -> Either<L, O>): Either<L, O>

fold

fun <L, R, O> Either<L, R>.fold(lf: (L) -> O, rf: (R) -> O): O

map

infix fun <L, R, O> Either<L, R>.map(f: (R) -> O): Either<L, O>

mapLeft

infix fun <L, R, O> Either<L, O>.mapLeft(f: (L) -> R): Either<R, O>

Inheritors

Left

data class Left<out L> : Either<L, Nothing>

Right

data class Right<out T> : Either<Nothing, T>