Left

data class Left<out A>(val value: A) : Ior<A, Nothing>

Constructors

Link copied to clipboard
fun <out A> Left(value: A)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
inline fun all(predicate: (Nothing) -> Boolean): Boolean
Link copied to clipboard
inline fun <C, D> bicrosswalk(fa: (A) -> Iterable<C>, fb: (Nothing) -> Iterable<D>): List<Ior<C, D>>
Link copied to clipboard
inline fun <C, D, K> bicrosswalkMap(fa: (A) -> Map<K, C>, fb: (Nothing) -> Map<K, D>): Map<K, Ior<C, D>>
Link copied to clipboard
inline fun <C, D> bicrosswalkNull(fa: (A) -> C?, fb: (Nothing) -> D?): Ior<C, D>?
Link copied to clipboard
inline fun <C> bifoldLeft(c: C, f: (C, A) -> C, g: (C, Nothing) -> C): C
Link copied to clipboard
inline fun <C> bifoldMap(MN: Monoid<C>, f: (A) -> C, g: (Nothing) -> C): C
Link copied to clipboard
inline fun <C, D> bimap(fa: (A) -> C, fb: (Nothing) -> 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: (A) -> Iterable<AA>, fb: (Nothing) -> Iterable<C>): List<Ior<AA, C>>
Link copied to clipboard
inline fun <AA, C, D> bitraverseEither(fa: (A) -> Either<AA, C>, fb: (Nothing) -> Either<AA, D>): Either<AA, Ior<C, D>>
Link copied to clipboard
inline fun <C, D> bitraverseNullable(fa: (A) -> C?, fb: (Nothing) -> D?): Ior<C, D>?
Link copied to clipboard
inline fun <C, D> bitraverseOption(fa: (A) -> Option<C>, fb: (Nothing) -> Option<D>): Option<Ior<C, D>>
Link copied to clipboard
inline fun <AA, C, D> bitraverseValidated(SA: Semigroup<AA>, fa: (A) -> Validated<AA, C>, fb: (Nothing) -> Validated<AA, D>): Validated<AA, Ior<C, D>>
Link copied to clipboard
inline fun <C> crosswalk(fa: (Nothing) -> Iterable<C>): List<Ior<A, C>>
Link copied to clipboard
inline fun <K, V> crosswalkMap(fa: (Nothing) -> Map<K, V>): Map<K, Ior<A, 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: (Nothing) -> 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: (Nothing) -> Boolean): Nothing?
Link copied to clipboard
inline fun <C> fold(fa: (A) -> C, fb: (Nothing) -> C, fab: (A, Nothing) -> 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, Nothing) -> C): C
Link copied to clipboard
inline fun <C> foldMap(MN: Monoid<C>, f: (Nothing) -> C): C
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun leftOrNull(): A?

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: (Nothing) -> D): Ior<A, D>

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

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

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

Link copied to clipboard
fun orNull(): Nothing?

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<A?, Nothing?>

Return this Ior as Pair of nullables]

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

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

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

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: (Nothing) -> Either<AA, C>): Either<AA, Ior<A, C>>
inline fun <C> traverse(fa: (Nothing) -> Option<C>): Option<Ior<A, C>>
inline fun <AA, C> traverse(fa: (Nothing) -> Validated<AA, C>): Validated<AA, Ior<A, C>>
inline fun <C> traverse(fa: (Nothing) -> Iterable<C>): List<Ior<A, C>>
Link copied to clipboard
inline fun <AA, C> traverseEither(fa: (Nothing) -> Either<AA, C>): Either<AA, Ior<A, C>>
Link copied to clipboard
inline fun <C> traverseNullable(fa: (Nothing) -> C?): Ior<A, C>?
Link copied to clipboard
inline fun <C> traverseOption(fa: (Nothing) -> Option<C>): Option<Ior<A, C>>
Link copied to clipboard
inline fun <AA, C> traverseValidated(fa: (Nothing) -> Validated<AA, C>): Validated<AA, Ior<A, C>>
Link copied to clipboard

Return the isomorphic Either of this Ior

Link copied to clipboard
fun void(): Ior<A, 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: A

Extensions

Link copied to clipboard
fun <A, B> Ior<Iterable<A>, Iterable<B>>.bisequence(): List<Ior<A, B>>
Link copied to clipboard
fun <A, B, C> Ior<Either<A, B>, Either<A, C>>.bisequenceEither(): Either<A, Ior<B, C>>
Link copied to clipboard
fun <B, C> Ior<B?, C?>.bisequenceNullable(): Ior<B, C>?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <A, B> Ior<A, B>.combine(SA: Semigroup<A>, SB: Semigroup<B>, other: Ior<A, B>): Ior<A, B>
Link copied to clipboard
operator fun <A : Comparable<A>, B : Comparable<B>> Ior<A, B>.compareTo(other: Ior<A, B>): Int
Link copied to clipboard
inline fun <A, B, D> Ior<A, B>.flatMap(SG: Semigroup<A>, f: (B) -> Ior<A, D>): Ior<A, D>

Binds the given function across Ior.Right.

Link copied to clipboard
inline fun <A, B> Ior<A, Ior<A, B>>.flatten(SA: Semigroup<A>): Ior<A, B>
Link copied to clipboard
inline fun <A, B> Ior<A, B>.getOrElse(default: () -> B): B
Link copied to clipboard
fun <AA, A : AA, B> Ior<A, B>.leftWiden(): Ior<AA, B>
Link copied to clipboard
fun <A, B> Ior<A, B>.replicate(SA: Semigroup<A>, n: Int): Ior<A, List<B>>
fun <A, B> Ior<A, B>.replicate(SA: Semigroup<A>, n: Int, MB: Monoid<B>): Ior<A, B>
Link copied to clipboard
fun <A, B> Ior<A, Iterable<B>>.sequence(): List<Ior<A, B>>
fun <A, B, C> Ior<A, Either<B, C>>.sequence(): Either<B, Ior<A, C>>
fun <A, B> Ior<A, Option<B>>.sequence(): Option<Ior<A, B>>
fun <A, B> Ior<A, B?>.sequence(): Ior<A, B>?
fun <A, B, C> Ior<A, Validated<B, C>>.sequence(): Validated<B, Ior<A, C>>
Link copied to clipboard
fun <A, B, C> Ior<A, Either<B, C>>.sequenceEither(): Either<B, Ior<A, C>>
Link copied to clipboard
fun <A, B> Ior<A, B?>.sequenceNullable(): Ior<A, B>?
Link copied to clipboard
fun <A, B> Ior<A, Option<B>>.sequenceOption(): Option<Ior<A, B>>
Link copied to clipboard
Link copied to clipboard
fun <A, C, B : C> Ior<A, B>.widen(): Ior<A, C>

Given B is a sub type of C, re-type this value from Ior to Ior

Link copied to clipboard
fun <A, B, C> Ior<A, B>.zip(SA: Semigroup<A>, fb: Ior<A, C>): Ior<A, Pair<B, C>>
inline fun <A, B, C, D> Ior<A, B>.zip(SA: Semigroup<A>, c: Ior<A, C>, map: (B, C) -> D): Ior<A, D>
inline fun <A, B, C, D, E> Ior<A, B>.zip(SA: Semigroup<A>, c: Ior<A, C>, d: Ior<A, D>, map: (B, C, D) -> E): Ior<A, E>
inline fun <A, B, C, D, E, F> Ior<A, B>.zip(SA: Semigroup<A>, c: Ior<A, C>, d: Ior<A, D>, e: Ior<A, E>, map: (B, C, D, E) -> F): Ior<A, F>
inline fun <A, B, C, D, E, F, G> Ior<A, B>.zip(SA: Semigroup<A>, c: Ior<A, C>, d: Ior<A, D>, e: Ior<A, E>, f: Ior<A, F>, map: (B, C, D, E, F) -> G): Ior<A, G>
inline fun <A, B, C, D, E, F, G, H> Ior<A, B>.zip(SA: Semigroup<A>, c: Ior<A, C>, d: Ior<A, D>, e: Ior<A, E>, f: Ior<A, F>, g: Ior<A, G>, map: (B, C, D, E, F, G) -> H): Ior<A, H>
inline fun <A, B, C, D, E, F, G, H, I> Ior<A, B>.zip(SA: Semigroup<A>, c: Ior<A, C>, d: Ior<A, D>, e: Ior<A, E>, f: Ior<A, F>, g: Ior<A, G>, h: Ior<A, H>, map: (B, C, D, E, F, G, H) -> I): Ior<A, I>
inline fun <A, B, C, D, E, F, G, H, I, J> Ior<A, B>.zip(SA: Semigroup<A>, c: Ior<A, C>, d: Ior<A, D>, e: Ior<A, E>, f: Ior<A, F>, g: Ior<A, G>, h: Ior<A, H>, i: Ior<A, I>, map: (B, C, D, E, F, G, H, I) -> J): Ior<A, J>
inline fun <A, B, C, D, E, F, G, H, I, J, K> Ior<A, B>.zip(SA: Semigroup<A>, c: Ior<A, C>, d: Ior<A, D>, e: Ior<A, E>, f: Ior<A, F>, g: Ior<A, G>, h: Ior<A, H>, i: Ior<A, I>, j: Ior<A, J>, map: (B, C, D, E, F, G, H, I, J) -> K): Ior<A, K>
inline fun <A, B, C, D, E, F, G, H, I, J, K, L> Ior<A, B>.zip(SA: Semigroup<A>, c: Ior<A, C>, d: Ior<A, D>, e: Ior<A, E>, f: Ior<A, F>, g: Ior<A, G>, h: Ior<A, H>, i: Ior<A, I>, j: Ior<A, J>, k: Ior<A, K>, map: (B, C, D, E, F, G, H, I, J, K) -> L): Ior<A, L>