RestrictedEitherEffect

fun interface RestrictedEitherEffect<E, A> : EitherEffect<E, A>

Functions

Link copied to clipboard
open suspend fun <B> Either<E, B>.bind(): B
open suspend fun <B> Validated<E, B>.bind(): B
open suspend fun <B> Result<B>.bind(transform: (Throwable) -> E): B
Link copied to clipboard
abstract fun control(): DelimitedScope<Either<E, A>>
Link copied to clipboard
open suspend fun ensure(value: Boolean, orLeft: () -> E)

Ensure check if the value is true, and if it is it allows the either { } binding to continue. In case it is false, then it short-circuits the binding and returns the provided value by orLeft inside an Either.Left.