# NullableEffectScope

## Functions

open suspend fun <E, A> attempt(f: suspend EffectScope<E>.() -> A): suspend EffectScope<E>.() -> A

Encloses an action for which you want to catch any `shift`. attempt is used in combination with catch.

open suspend fun <B> Either<Nothing?, B>.bind(): B

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

open suspend fun <B> Validated<Nothing?, B>.bind(): B

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

open suspend fun <B> EagerEffect<Nothing?, 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<Nothing?, B>.bind(): B

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

suspend fun <B> B?.bind(): B
suspend fun <B> Option<B>.bind(): B

open suspend fun <B> Option<B>.bind(shift: () -> Nothing?): 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) -> Nothing?): B

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

open infix suspend fun <E, A> suspend EffectScope<E>.() -> A.catch(recover: suspend EffectScope<Nothing?>.(E) -> A): A

When the Effect has shifted with R it will recover the shifted value to A, and when it ran the computation to completion it will return the value A. catch is used in combination with attempt.

suspend fun ensure(value: Boolean)

open suspend fun ensure(condition: Boolean, shift: () -> Nothing?)

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

Ensure that value is not `null`. if it's non-null it will be smart-casted and returned if it's `false` it will `shift` with the provided value R. Monadic version of kotlin.requireNotNull.