CLOVIS
12/01/2022, 9:17 AMsimon.vergauwen
12/01/2022, 9:18 AMEither
.
I.e.
fun example(): Either<String, Int>
translates to
context(EffectScope<String>)
fun example2(): Int
CLOVIS
12/01/2022, 9:19 AMCLOVIS
12/01/2022, 9:19 AMsimon.vergauwen
12/01/2022, 9:19 AMcontext receivers
is this.
https://github.com/nomisRev/ktor-arrow-example/blob/0d43ef0282fcb4fc74ff512fb22295ec6119c3d4/build.gradle.kts#L43CLOVIS
12/01/2022, 9:20 AMEffectScope
and not Raise
, is there any difference apart from the naming?CLOVIS
12/01/2022, 9:21 AMsimon.vergauwen
12/01/2022, 9:23 AMEffectScope
which is in the latest stable.
Raise
is the new name we agreed upon in this channel for 2.x.x and relates to my question of the migration you replied on 😉 I'm working on trying to backport it in a source-compatible way.
The biggest difference between EffectScope
and Raise
is that Raise
works through inline
and thus relies on extension functions. Hence the need to add some additional imports.
Thanks through inline
there will be no more need for EagerEffectScope
nor for either.eager { }
vs either { }
chiroptical
12/02/2022, 3:11 PMsimon.vergauwen
12/02/2022, 3:12 PMchiroptical
12/02/2022, 3:12 PMCLOVIS
12/04/2022, 9:10 AM