Right

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

Constructors

Link copied to clipboard
fun <out B> Right(value: B)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
inline fun all(predicate: (B) -> Boolean): Boolean
Link copied to clipboard
inline fun <C, D> bicrosswalk(fa: (Nothing) -> Iterable<C>, fb: (B) -> Iterable<D>): List<Ior<C, D>>
Link copied to clipboard
inline fun <C, D, K> bicrosswalkMap(fa: (Nothing) -> Map<K, C>, fb: (B) -> Map<K, D>): Map<K, Ior<C, D>>
Link copied to clipboard
inline fun <C, D> bicrosswalkNull(fa: (Nothing) -> C?, fb: (B) -> D?): Ior<C, D>?
Link copied to clipboard
inline fun <C> bifoldLeft(    c: C,     f: (C, Nothing) -> C,     g: (C, B) -> C): C
Link copied to clipboard
inline fun <C> bifoldMap(    MN: Monoid<C>,     f: (Nothing) -> C,     g: (B) -> C): C
Link copied to clipboard
inline fun <C, D> bimap(fa: (Nothing) -> C, fb: (B) -> D): Ior<C, D>

Apply fa if this is a Left or Both to A and apply fb if this is Right or Both to B

Link copied to clipboard
inline fun <AA, C> bitraverse(fa: (Nothing) -> Iterable<AA>, fb: (B) -> Iterable<C>): List<Ior<AA, C>>
Link copied to clipboard
inline fun <AA, C, D> bitraverseEither(fa: (Nothing) -> Either<AA, C>, fb: (B) -> Either<AA, D>): Either<AA, Ior<C, D>>
Link copied to clipboard
inline fun <C, D> bitraverseNullable(fa: (Nothing) -> C?, fb: (B) -> D?): Ior<C, D>?
Link copied to clipboard
inline fun <C, D> bitraverseOption(fa: (Nothing) -> Option<C>, fb: (B) -> Option<D>): Option<Ior<C, D>>
Link copied to clipboard
inline fun <AA, C, D> bitraverseValidated(    SA: Semigroup<AA>,     fa: (Nothing) -> Validated<AA, C>,     fb: (B) -> Validated<AA, D>): Validated<AA, Ior<C, D>>
Link copied to clipboard
inline fun <C> crosswalk(fa: (B) -> Iterable<C>): List<Ior<Nothing, C>>
Link copied to clipboard
inline fun <K, V> crosswalkMap(fa: (B) -> Map<K, V>): Map<K, Ior<Nothing, V>>
Link copied to clipboard
inline fun <A, B, C> crosswalkNull(ior: Ior<A, B>, fa: (B) -> C?): Ior<A, C>?
Link copied to clipboard
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.

Link copied to clipboard
inline fun findOrNull(predicate: (B) -> Boolean): B?
Link copied to clipboard
inline fun <C> fold(    fa: (Nothing) -> C,     fb: (B) -> C,     fab: (Nothing, B) -> C): C

Applies fa if this is a Left, fb if this is a Right or fab if this is a Both

Link copied to clipboard
inline fun <C> foldLeft(c: C, f: (C, B) -> C): C
Link copied to clipboard
inline fun <C> foldMap(MN: Monoid<C>, f: (B) -> C): C
Link copied to clipboard
fun isEmpty(): Boolean
Link copied to clipboard
fun isNotEmpty(): Boolean
Link copied to clipboard
fun leftOrNull(): Nothing?

Returns the Left value or A if this is Left or Both and null if this is a Right.

Link copied to clipboard
inline fun <D> map(f: (B) -> D): Ior<Nothing, D>

The given function is applied if this is a Right or Both to B.

Link copied to clipboard
inline fun <C> mapLeft(fa: (Nothing) -> C): Ior<C, B>

The given function is applied if this is a Left or Both to A.

Link copied to clipboard
fun orNull(): B?

Returns the Right value or B if this is Right or Both and null if this is a Left.

Link copied to clipboard
fun padNull(): Pair<Nothing?, B?>

Return this Ior as Pair of nullables]

Link copied to clipboard
fun swap(): Ior<B, Nothing>

If this is a Left, then return the left value in Right or vice versa, when this is Both , left and right values are swap

Link copied to clipboard
fun toEither(): Either<Nothing, B>

Returns a Either.Right containing the Right value or B if this is Right or Both and Either.Left if this is a Left.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun toValidated(): Validated<Nothing, B>

Returns a Validated.Valid containing the Right value or B if this is Right or Both and Validated.Invalid if this is a Left.

Link copied to clipboard
inline fun <AA, C> traverse(fa: (B) -> Either<AA, C>): Either<AA, Ior<Nothing, C>>
inline fun <C> traverse(fa: (B) -> Option<C>): Option<Ior<Nothing, C>>
inline fun <AA, C> traverse(fa: (B) -> Validated<AA, C>): Validated<AA, Ior<Nothing, C>>
inline fun <C> traverse(fa: (B) -> Iterable<C>): List<Ior<Nothing, C>>
Link copied to clipboard
inline fun <AA, C> traverseEither(fa: (B) -> Either<AA, C>): Either<AA, Ior<Nothing, C>>
Link copied to clipboard
inline fun <C> traverseNullable(fa: (B) -> C?): Ior<Nothing, C>?
Link copied to clipboard
inline fun <C> traverseOption(fa: (B) -> Option<C>): Option<Ior<Nothing, C>>
Link copied to clipboard
inline fun <AA, C> traverseValidated(fa: (B) -> Validated<AA, C>): Validated<AA, Ior<Nothing, C>>
Link copied to clipboard
fun unwrap(): Either<Either<Nothing, B>, Pair<Nothing, B>>

Return the isomorphic Either of this Ior

Link copied to clipboard
fun void(): Ior<Nothing, Unit>

Properties

Link copied to clipboard
open override val isBoth: Boolean

Returns true if this is a Both, false otherwise.

Link copied to clipboard
open override val isLeft: Boolean

Returns true if this is a Left, false otherwise.

Link copied to clipboard
open override val isRight: Boolean

Returns true if this is a Right, false otherwise.

Link copied to clipboard
val value: B