None

object None : Option<Nothing>

Functions

Link copied to clipboard
infix fun <B> align(b: Option<B>): Option<Ior<Nothing, B>>

Align two options (this on the left and b on the right) as one Option of Ior.

inline fun <B, C> align(b: Option<B>, f: (Ior<Nothing, B>) -> C): Option<C>

Align two options (this on the left and b on the right) as one Option of Ior, and then, if it's not None, map it using f.

Link copied to clipboard
inline fun all(predicate: (Nothing) -> Boolean): Boolean

Returns true if this option is empty '''or''' the predicate $predicate returns true when applied to this $option's value.

Link copied to clipboard
infix fun <X> and(value: Option<X>): Option<X>
Link copied to clipboard
inline fun <B> crosswalk(f: (Nothing) -> Option<B>): Option<Option<B>>
Link copied to clipboard
inline fun <K, V> crosswalkMap(f: (Nothing) -> Map<K, V>): Map<K, Option<V>>
Link copied to clipboard
inline fun <B> crosswalkNull(f: (Nothing) -> B?): Option<B>?
Link copied to clipboard
inline fun exists(predicate: (Nothing) -> Boolean): Boolean

Returns true if this option is nonempty '''and''' the predicate $p returns true when applied to this $option's value. Otherwise, returns false.

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

Returns this $option if it is nonempty '''and''' applying the predicate $p to this $option's value returns true. Otherwise, return $none.

Link copied to clipboard
inline fun filterNot(predicate: (Nothing) -> Boolean): Option<Nothing>

Returns this $option if it is nonempty '''and''' applying the predicate $p to this $option's value returns false. Otherwise, return $none.

Link copied to clipboard
inline fun findOrNull(predicate: (Nothing) -> Boolean): Nothing?

Returns the $option's value if this option is nonempty '''and''' the predicate $p returns true when applied to this $option's value. Otherwise, returns null.

Link copied to clipboard
inline fun <B> flatMap(f: (Nothing) -> Option<B>): Option<B>

Returns the result of applying $f to this $option's value if this $option is nonempty. Returns $none if this $option is empty. Slightly different from map in that $f is expected to return an $option (which could be $none).

Link copied to clipboard
inline fun <R> fold(ifEmpty: () -> R, ifSome: (Nothing) -> R): R
Link copied to clipboard
inline fun <B> foldLeft(initial: B, operation: (B, Nothing) -> B): B
Link copied to clipboard
inline fun <B> foldMap(MB: Monoid<B>, f: (Nothing) -> B): B
Link copied to clipboard
fun isDefined(): Boolean

Returns true if the option is an instance of Some, false otherwise.

Link copied to clipboard
open override fun isEmpty(): Boolean

Returns true if the option is None, false otherwise.

Link copied to clipboard
fun isNotEmpty(): Boolean
Link copied to clipboard
inline fun <B> map(f: (Nothing) -> B): Option<B>

Returns a Some<$B> containing the result of applying $f to this $option's value if this $option is nonempty. Otherwise return $none.

Link copied to clipboard
inline fun <B> mapNotNull(f: (Nothing) -> B?): Option<B>

Returns $none if the result of applying $f to this $option's value is null. Otherwise returns the result.

Link copied to clipboard
fun nonEmpty(): Boolean

alias for isDefined

Link copied to clipboard
fun orNull(): Nothing?
Link copied to clipboard
fun <B> padZip(other: Option<B>): Option<Pair<Nothing?, B?>>
inline fun <B, C> padZip(other: Option<B>, f: (Nothing?, B?) -> C): Option<C>
Link copied to clipboard
fun <L> pairLeft(left: L): Option<Pair<L, Nothing>>
Link copied to clipboard
fun <R> pairRight(right: R): Option<Pair<Nothing, R>>
Link copied to clipboard
inline fun <B> reduceOrNull(initial: (Nothing) -> B, operation: (B, Nothing) -> B): B?
Link copied to clipboard
inline fun <B> reduceRightEvalOrNull(initial: (Nothing) -> B, operation: (Nothing, acc: Eval<B>) -> Eval<B>): Eval<B?>
Link copied to clipboard
fun replicate(n: Int): Option<List<Nothing>>
Link copied to clipboard
inline fun tap(f: (Nothing) -> Unit): Option<Nothing>

The given function is applied as a fire and forget effect if this is a some. When applied the result is ignored and the original Some value is returned

Link copied to clipboard
inline fun tapNone(f: () -> Unit): Option<Nothing>

The given function is applied as a fire and forget effect if this is a None. When applied the result is ignored and the original None value is returned

Link copied to clipboard
inline fun <L> toEither(ifEmpty: () -> L): Either<L, Nothing>
Link copied to clipboard
fun toList(): List<Nothing>
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
inline fun <AA, B> traverse(fa: (Nothing) -> Either<AA, B>): Either<AA, Option<B>>
inline fun <AA, B> traverse(fa: (Nothing) -> Validated<AA, B>): Validated<AA, Option<B>>
inline fun <B> traverse(fa: (Nothing) -> Iterable<B>): List<Option<B>>
Link copied to clipboard
inline fun <AA, B> traverseEither(fa: (Nothing) -> Either<AA, B>): Either<AA, Option<B>>
Link copied to clipboard
inline fun <AA, B> traverseValidated(fa: (Nothing) -> Validated<AA, B>): Validated<AA, Option<B>>
Link copied to clipboard
fun void(): Option<Unit>
Link copied to clipboard
fun <B> zip(other: Option<B>): Option<Pair<Nothing, B>>
inline fun <B, C> zip(b: Option<B>, map: (Nothing, B) -> C): Option<C>
inline fun <B, C, D> zip(    b: Option<B>,     c: Option<C>,     map: (Nothing, B, C) -> D): Option<D>
inline fun <B, C, D, E> zip(    b: Option<B>,     c: Option<C>,     d: Option<D>,     map: (Nothing, B, C, D) -> E): Option<E>
inline fun <B, C, D, E, F> zip(    b: Option<B>,     c: Option<C>,     d: Option<D>,     e: Option<E>,     map: (Nothing, B, C, D, E) -> F): Option<F>
inline fun <B, C, D, E, F, G> zip(    b: Option<B>,     c: Option<C>,     d: Option<D>,     e: Option<E>,     f: Option<F>,     map: (Nothing, B, C, D, E, F) -> G): Option<G>
inline fun <B, C, D, E, F, G, H> zip(    b: Option<B>,     c: Option<C>,     d: Option<D>,     e: Option<E>,     f: Option<F>,     g: Option<G>,     map: (Nothing, B, C, D, E, F, G) -> H): Option<H>
inline fun <B, C, D, E, F, G, H, I> zip(    b: Option<B>,     c: Option<C>,     d: Option<D>,     e: Option<E>,     f: Option<F>,     g: Option<G>,     h: Option<H>,     map: (Nothing, B, C, D, E, F, G, H) -> I): Option<I>
inline fun <B, C, D, E, F, G, H, I, J> zip(    b: Option<B>,     c: Option<C>,     d: Option<D>,     e: Option<E>,     f: Option<F>,     g: Option<G>,     h: Option<H>,     i: Option<I>,     map: (Nothing, B, C, D, E, F, G, H, I) -> J): Option<J>
inline fun <B, C, D, E, F, G, H, I, J, K> zip(    b: Option<B>,     c: Option<C>,     d: Option<D>,     e: Option<E>,     f: Option<F>,     g: Option<G>,     h: Option<H>,     i: Option<I>,     j: Option<J>,     map: (Nothing, B, C, D, E, F, G, H, I, J) -> K): Option<K>