Right

interface Right<out R> : Either<Nothing, R>

The right side of an Either

Parameters

R

The type of values held in this class

Properties

Link copied to clipboard
abstract val value: R

An R value

Inherited functions

Link copied to clipboard
inline fun <L, R, T> Either<L, R>.fold(ifLeft: (left: L) -> T, ifRight: (right: R) -> T): T

Transform this Either into a value of type T via specialized mapping functions for both left and right values

Link copied to clipboard
inline fun <L, R, R2> Either<L, R>.map(func: (right: R) -> R2): Either<L, R2>

Map the right value of this Either to a new value. Left values are unmodified.

Link copied to clipboard
fun <T> Either<T, T>.merge(): T

Returns the left value or right value