Right

data class Right<R>(val r: R) : Either<Nothing, R> (source)

The right case of an Either.

Constructors

Link copied to clipboard
constructor(r: R)

Properties

Link copied to clipboard
val r: R

Functions

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

flat-map over the Right side of this Either.

Link copied to clipboard
inline fun <T> fold(fL: (Nothing) -> T, fR: (R) -> T): T

fold this.

Link copied to clipboard
inline fun <T> map(f: (R) -> T): Either<Nothing, T>

Maps over the Right side of this Either.

Link copied to clipboard
fun toOption(): Option<R>

Turns this Either into an Option, the Right side becomes Some the left side is ignored and turned into None.