//arrow-core/arrow.core.continuations/EffectScope
common interface EffectScope<R>
Context of the Effect DSL.
Name | Summary |
---|---|
bind | common open suspend fun <B> Either<R, B>.bind(): B Folds Either into Effect, by returning B or a shift with R. common open suspend fun <B> Validated<R, B>.bind(): B Folds Validated into Effect, by returning B or a shift with R. common open suspend fun <B> EagerEffect<R, B>.bind(): B Runs the EagerEffect to finish, returning B or shift in case of R, bridging eager computations into suspending. common open suspend fun <B> Effect<R, B>.bind(): B Runs the Effect to finish, returning B or shift in case of R. common open suspend fun <B> Option<B>.bind(shift: () -> R): B Folds Option into Effect, by returning B or a transforming None into R and shifting the result. common open suspend fun <B> Result<B>.bind(transform: (Throwable) -> R): B Folds Result into Effect, by returning B or a transforming Throwable into R and shifting the result. |
ensure | common open suspend fun ensure(condition: Boolean, shift: () -> R) ensure that condition is true , if it’s false it will shift with the provided value R. Monadic version of kotlin.require. |
shift | common abstract suspend fun <B> shift(r: R): B Short-circuit the Effect computation with value R. |
Name |
---|
IorEffectScope |
NullableEffectScope |
OptionEffectScope |
ResultEffectScope |
Name | Summary |
---|---|
ensureNotNull | common suspend fun <R, B : Any> EffectScope<R>.ensureNotNull(value: B?, shift: () -> R): B 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. |
Do you like Arrow?
✖