sealed class Option<out T>
(source)
Represents an optional value with map, flatMap, fold and getOrElse to transform it.
fun filter(predicate: (T) -> Boolean): Option<T> |
|
fun <R> flatMap(f: (T) -> Option<R>): Option<R> |
|
fun <R> fold(default: () -> R, f: (T) -> R): R |
|
fun isDefined(): Boolean |
|
fun <R> map(f: (T) -> R): Option<R> |
fun <T> someIf(predicate: Boolean, provider: () -> T): Option<T> |
fun <T> Option<T>.getOrElse(default: () -> T): T |
object None : Option<Nothing>
Represents an absent value in terms of Option. |
|
data class Some<T> : Option<T>
Represents a present value in terms of Option. |