Marko Novakovic
05/20/2022, 3:01 PMEffect
. can somebody give me concrete example where difference between Effect
and Either
is clear?stojan
05/20/2022, 3:08 PMstojan
05/20/2022, 3:09 PMMarko Novakovic
05/20/2022, 3:09 PMEffect
from thereMarko Novakovic
05/20/2022, 3:12 PMraulraja
05/20/2022, 9:19 PMraulraja
05/20/2022, 9:21 PMEffectScope
to make Either
disappear.
context(EffectScope<E>)
suspend fun <E, A> foo(): A = shift(e)
vs
suspend fun <E, A> foo(): Either<E, A> = Left(e)
raulraja
05/20/2022, 9:22 PMEffectScope
you can use shift
as a functional throw
which can return an alternative value of E
when otherwise the happy path of your function return type remains simple as just A
Marko Novakovic
05/20/2022, 9:47 PM