Either

sealed class Either<out A, out B>

Generic wrapper to store two mutually exclusive types.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Left<A, B>(val value: A) : Either<A, B>
Link copied to clipboard
data class Right<A, B>(val value: B) : Either<A, B>

Properties

Link copied to clipboard
val left: A?
Link copied to clipboard
val right: B?

Functions

Link copied to clipboard
inline fun onLeft(action: (value: A) -> Unit): Either<A, B>
Link copied to clipboard
inline fun onRight(action: (value: B) -> Unit): Either<A, B>