EagerEffect
RestrictsSuspension version of Effect. This version runs eagerly, and can be used in non-suspending code. An effect computation interoperates with an EagerEffect via bind
.
See also
Functions
Link copied to clipboard
Runs the non-suspending computation by creating a Continuation with an EmptyCoroutineContext, and running the fold
function over the computation.
open fun <B> fold(error: (error: Throwable) -> B, recover: (shifted: R) -> B, transform: (value: A) -> B): B
Like fold
but also allows folding over any unexpected Throwable that might have occurred.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun <R2, B> redeemWith(f: (R) -> EagerEffect<R2, B>, g: (A) -> EagerEffect<R2, B>): EagerEffect<R2, B>
Link copied to clipboard
fold the EagerEffect into an Either. Where the shifted value R is mapped to Either.Left, and result value A is mapped to Either.Right.
Link copied to clipboard
fold the EagerEffect into an Validated. Where the shifted value R is mapped to Validated.Invalid, and result value A is mapped to Validated.Valid.