Package-level declarations

Contains Option and Either.

Types

Link copied to clipboard
sealed class Either<out L, out R>

Represents a disjoint union i.e. a type with two possibilities, either Left or Right.

Link copied to clipboard
data class Left<L>(val l: L) : Either<L, Nothing>

The left case of an Either.

Link copied to clipboard
object None : Option<Nothing>

Represents an absent value in terms of Option.

Link copied to clipboard
sealed class Option<out T>

Represents an optional value with map, flatMap, fold and getOrElse to transform it.

Link copied to clipboard
data class Right<R>(val r: R) : Either<Nothing, R>

The right case of an Either.

Link copied to clipboard
data class Some<T>(val value: T) : Option<T>

Represents a present value in terms of Option.

Properties

Link copied to clipboard

Returns false on calling.

Link copied to clipboard

Returns true on calling.

Functions

Link copied to clipboard
inline fun <L, R, T> Either<L, R>.flatMap(f: (R) -> Either<L, T>): Either<L, T>

flat-map over the Right side of this Either.

Link copied to clipboard
inline fun <T> Option<T>.getOrElse(default: () -> T): T

Get the value of this Option if defined or use the default-value provider.