enum Option
source · line 8public
public enum Option<T>
A value that is either Some or None. The spelling T? denotes Option<T>; absence is
represented explicitly and can be matched exhaustively.
Extensions
public fun <T, R> Option<T>.flatMap(transform: (T) -> R?): R?· scoop:scoop.std:0.1.0public fun <T> Option<T>.filter(predicate: (T) -> Boolean): T?· scoop:scoop.std:0.1.0public fun <T, E> Option<T>.toResult(errorProducer: () -> E): Result<T, E>· scoop:scoop.std:0.1.0public fun <T> Option<T>.getOrElse(defaultValue: () -> T): T· scoop:scoop.std:0.1.0public fun <T, R> Option<T>.fold(onSome: (T) -> R, onNone: () -> R): R· scoop:scoop.std:0.1.0public fun <T> Option<T>.orElse(defaultValue: () -> T?): T?· scoop:scoop.std:0.1.0public fun <T, R> Option<T>.map(transform: (T) -> R): R?· scoop:scoop.std:0.1.0
type parameter T
source · line 8public
T
variant None
source · line 16public
None
Represents the absence of a value.
variant Some
source · line 12public
Some(T)
Contains the present value.
field _
source · line 12public
T
parameter _
source · line 12public
T
function equals
source · line 8publiccompiler-derived
operator fun equals(other: Option<T>): Boolean
This derived operation is available when each field or payload type supports same-type equality. Required types: T.