Some

data class Some<T>(val value: T) : Option<T> (source)

Represents a present value in terms of Option.

Constructors

Link copied to clipboard
constructor(value: T)

Properties

Link copied to clipboard
val value: T

Functions

Link copied to clipboard
inline fun filter(predicate: (T) -> Boolean): Option<T>

Filters the value if defined by the given predicate.

Link copied to clipboard
inline fun <R> flatMap(f: (T) -> Option<R>): Option<R>

Flat-maps over the value if defined.

Link copied to clipboard
inline fun <R> fold(default: () -> R, f: (T) -> R): R

Folds this Option.

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.

Link copied to clipboard
Link copied to clipboard
inline fun <R> map(f: (T) -> R): Option<R>

Maps over the value if defined.