# Right

data class Right<out B>(val value: B) : Either<Nothing, B>

The right side of the disjoint union, as opposed to the Left side.

## Constructors

fun <out B> Right(value: B)

object Companion

## Functions

inline fun all(predicate: (B) -> Boolean): Boolean

Returns `true` if Left or returns the result of the application of the given predicate to the Right value.

inline fun <C> bifoldLeft(    c: C,     f: (C, Nothing) -> C,     g: (C, B) -> C): C
inline fun <C> bifoldMap(    MN: Monoid<C>,     f: (Nothing) -> C,     g: (B) -> C): C
inline fun <C, D> bimap(leftOperation: (Nothing) -> C, rightOperation: (B) -> D): Either<C, D>

Map over Left and Right of this Either

inline fun <AA, C> bitraverse(fe: (Nothing) -> Iterable<AA>, fa: (B) -> Iterable<C>): List<Either<AA, C>>
inline fun <AA, C> bitraverseNullable(fl: (Nothing) -> AA?, fr: (B) -> C?): Either<AA, C>?
inline fun <AA, C> bitraverseOption(fl: (Nothing) -> Option<AA>, fr: (B) -> Option<C>): Option<Either<AA, C>>
inline fun <AA, C, D> bitraverseValidated(fe: (Nothing) -> Validated<AA, C>, fa: (B) -> Validated<AA, D>): Validated<AA, Either<C, D>>
inline fun exists(predicate: (B) -> Boolean): Boolean

Returns `false` if Left or returns the result of the application of the given predicate to the Right value.

inline fun findOrNull(predicate: (B) -> Boolean): B?
inline fun <C> fold(ifLeft: (Nothing) -> C, ifRight: (B) -> C): C

Applies `ifLeft` if this is a Left or `ifRight` if this is a Right.

inline fun <C> foldLeft(initial: C, rightOperation: (C, B) -> C): C
fun <C> foldMap(MN: Monoid<C>, f: (B) -> C): C
fun isEmpty(): Boolean

Returns `true` if Left

fun isLeft(): Boolean
fun isNotEmpty(): Boolean

Returns `true` if Right

fun isRight(): Boolean
inline fun <C> map(f: (B) -> C): Either<Nothing, C>

The given function is applied if this is a Right.

inline fun <C> mapLeft(f: (Nothing) -> C): Either<C, B>

The given function is applied if this is a Left.

fun orNone(): Option<B>
fun orNull(): B?

Returns the right value if it exists, otherwise null

fun replicate(n: Int): Either<Nothing, List<B>>
fun swap(): Either<B, Nothing>

If this is a Left, then return the left value in Right or vice versa.

inline fun tap(f: (B) -> Unit): Either<Nothing, B>

The given function is applied as a fire and forget effect if this is a Right. When applied the result is ignored and the original Either value is returned

inline fun tapLeft(f: (Nothing) -> Unit): Either<Nothing, B>

The given function is applied as a fire and forget effect if this is a Left. When applied the result is ignored and the original Either value is returned

open override fun toString(): String
fun toValidated(): Validated<Nothing, B>
fun toValidatedNel(): ValidatedNel<Nothing, B>
inline fun <C> traverse(fa: (B) -> Option<C>): Option<Either<Nothing, C>>
inline fun <AA, C> traverse(fa: (B) -> Validated<AA, C>): Validated<AA, Either<Nothing, C>>
inline fun <C> traverse(fa: (B) -> Iterable<C>): List<Either<Nothing, C>>