Hi, could it make sense to implement this code? ``...
# arrow
c
Hi, could it make sense to implement this code?
Copy code
fun interface EitherEffect<E, A> : Effect<Either<E, A>> {
    ...

    suspend operator fun <B> B?.invoke(e: E): B =
        this ?: control().shift(Left(e))
}
Copy code
val r1: Either<String, Int> = Right(1)
val r2: Either<String, Int> = Right(1)
val r3: Either<String, Int> = Right(1)
val r4: Int? = null

val composition: Either<String, Int> = either {
    val a = r1()
    val b = r2()
    val c = r3()
    val d = r4("fail")

    a + b + c + d
} // Left("fail")