dave08
02/22/2023, 4:21 PMpublic inline fun <R, A> effect(@BuilderInference noinline block: suspend Raise<R>.() -> A): Effect<R, A> = block
or is it only partially being deprecated?simon.vergauwen
02/22/2023, 4:28 PMEffectScope/EagerEffectScope
is getting replaced by Raise
, but this also meant it had to move package from arrow.core.continuations
to arrow.core.raise
to avoid conflicts in names and signatures.
Effect
is no longer an interface
but a simple typealias
for suspend Raise<E>.() -> A
and that comes with a significant amount of runtime performance benefits.
Similarly EagerEffect
is also no longer an interface
but also a typealias
for Raise<E>.() -> A
.
The reason for effect { }
is so that it can automatically infer R
using @BuilderInference
. Using regular lambda syntax is not able to do that.