Matched

data class Matched<out Value>(val value: Value) : CaseMatch<Value>

The root matched, including when value itself is null.

Constructors

Link copied to clipboard
constructor(value: Value)

Properties

Link copied to clipboard
Link copied to clipboard

Intentionally collapses CaseMatch.NoMatch and CaseMatch.Matched with a null value.

Functions

Link copied to clipboard

Chains a second match operation only after this result matched.

Link copied to clipboard
inline fun <Value, Result> CaseMatch<Value>.fold(onNoMatch: () -> Result, onMatched: (Value) -> Result): Result

Folds the exact matching result into an arbitrary value.

Link copied to clipboard

Kotlin-style function spelling of valueOrNull.

Link copied to clipboard
inline fun <Value, NewValue> CaseMatch<Value>.map(transform: (Value) -> NewValue): CaseMatch<NewValue>

Transforms a matched value while retaining an unmatched result.

Link copied to clipboard

Intentionally treats a matched null value as another nonmatch.