NullableEagerEffectScope

value class NullableEagerEffectScope(cont: EagerEffectScope<Nothing?>) : EagerEffectScope<Nothing?>

Functions

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

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

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

Folds Validated into EagerEffect, 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.

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 EagerEffect, 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 EagerEffect, by returning B or a transforming Throwable into R and shifting the result.

Link copied to clipboard
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.

Link copied to clipboard
open suspend override fun <B> shift(r: Nothing?): B

Short-circuit the EagerEffect computation with value R.

Extensions

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