OptionEffectScope

Constructors

Link copied to clipboard
constructor(cont: EffectScope<None>)

Functions

Link copied to clipboard
open suspend fun <B> Either<None, B>.bind(): B

Folds Either into Effect, by returning B or a shift with R.

open suspend fun <B> EagerEffect<None, B>.bind(): B

Runs the EagerEffect to finish, returning B or shift in case of R, bridging eager computations into suspending.

open suspend fun <B> Effect<None, B>.bind(): B

Runs the Effect to finish, returning B or shift in case of R.

open suspend fun <B> EagerEffect<None, B>.bind(): B
open suspend fun <B> Effect<None, B>.bind(): B
suspend fun <B> Option<B>.bind(): B

open suspend fun <B> Option<B>.bind(shift: () -> None): B

Folds Option into Effect, by returning B or a transforming None into R and shifting the result.

open suspend fun <B> Result<B>.bind(transform: (Throwable) -> None): B

Folds Result into Effect, by returning B or a transforming Throwable into R and shifting the result.

Link copied to clipboard
open suspend fun ensure(condition: Boolean, shift: () -> None)

ensure that condition is true, if it's false it will shift with the provided value R. Monadic version of kotlin.require.

suspend fun ensure(value: Boolean)
Link copied to clipboard
suspend fun <B> OptionEffectScope.ensureNotNull(value: B?): B
Link copied to clipboard
open infix suspend fun <E, A> suspend EffectScope<E>.() -> A.recover(recover: suspend EffectScope<None>.(E) -> A): A
Link copied to clipboard
open suspend override fun <B> shift(r: None): B

Short-circuit the Effect computation with value R.