OptionEffect

fun interface OptionEffect<A> : Effect<Option<A>>

Deprecated

OptionEffect<A> is replaced with arrow.core.raise.OptionRaise

Replace with

import arrow.core.raise.OptionRaise
OptionRaise

Functions

Link copied to clipboard
open suspend fun <B> Option<B>.bind(): B
Link copied to clipboard
abstract fun control(): DelimitedScope<Option<A>>
Link copied to clipboard
open suspend fun ensure(value: Boolean)

Ensure check if the value is true, and if it is it allows the option { } binding to continue. In case it is false, then it short-circuits the binding and returns None.

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
suspend fun <B : Any> OptionEffect<*>.ensureNotNull(value: B?): B

Ensures that value is not null. When the value is not null, then it will be returned as non null and the check value is now smart-checked to non-null. Otherwise, if the value is null then the option binding will short-circuit with None.