Companion

object Companion

Functions

Link copied to clipboard
fun <L> left(left: L): Either.Left<L>

Creates the left side of the disjoint union with provided value.

Link copied to clipboard
fun <L, R> leftWith(left: L): Either<L, R>

Creates the left side of the disjoint union with provided value and specific right type.

Link copied to clipboard
inline fun <R> of(action: () -> R): Either<Throwable, R>

Runs provided action and captures the result in Either. Use to capture result of given potentially throwing code.

Link copied to clipboard
fun <R> right(right: R): Either.Right<R>

Creates the right side of the disjoint union with provided value.

Link copied to clipboard
fun <L, R> rightWith(right: R): Either<L, R>

Creates the right side of the disjoint union with provided value and specific left type.