sealed class Option<out T>
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> |
|
data class Some<T> : Option<T> |