Oliver Eisenbarth
04/14/2023, 2:51 PMYoussef Shoaib [MOD]
04/14/2023, 3:14 PMraulraja
04/14/2023, 3:17 PMstreetsofboston
04/14/2023, 3:19 PMraulraja
04/14/2023, 3:19 PM;
raulraja
04/14/2023, 3:22 PM;
or implicit ;
is flatMap
and we have the context scopes that give us the monadic context from which we can exit the continuation with a value. Monads are still there and useful but they are no longer constrained by having a method called flatMap that takes a higher order function to advance. We can still achieve the same with context blocks or context receivers.raulraja
04/14/2023, 3:23 PMstreetsofboston
04/14/2023, 3:24 PMraulraja
04/14/2023, 3:24 PMraulraja
04/14/2023, 3:25 PMraulraja
04/14/2023, 3:25 PMraulraja
04/14/2023, 3:25 PMsimon.vergauwen
04/14/2023, 5:01 PMsuspend
, itâs just something that a lot of us like doing because in 99,99% of the cases you want (or need) suspend
there anyway at some point in your application.
If he meant it in the sense that Arrow uses Kotlin Coroutines for other things than KotlinX Coroutines, that is exactly whatâs meant for. There was a talk about it on KotlinConf, and Kotlin Std also does it in a bunch of places.
There are a quite some miss conceptions out there by either bad experience from âpre 0.12.xâ, or from people that have bad memories from other languages and communities.
But there is also a lot of love, which is what counts đOliver Eisenbarth
04/14/2023, 6:22 PMOliver Eisenbarth
04/14/2023, 7:28 PMArrow doesnât impose in any way that you need to mark side-effects withTBH I think don't understand that fully myself. Are you saying, that the examples on the documentation page "working-with-typed-errors" that are suspended also could be not? Is moving from, itâs just something that a lot of us like doing because in 99,99% of the cases you want (or need)suspend
there anyway at some point in your application.suspend
fun Raise<UserNotFound>,user()
to
suspend fun Raise<UserNotFound>.fetchUser(id: Long)
only a coincidence? Sorry for my dumb questions. đââď¸Youssef Shoaib [MOD]
04/14/2023, 7:32 PMIO
. That's btw new since before Raise
was EffectScope
and it was coroutines-based, but it isn't anymore (that might be the source of those criticisms).simon.vergauwen
04/14/2023, 7:49 PMThat's btw new since beforeThis wasnât entirely the case since there was alsowasRaise
and it was coroutines-based, but it isn't anymore (that might be the source of those criticisms).EffectScope
EagerEffectScope
with @RestrictSuspension
.
So it didnât require suspend
, but a separate DSL.Youssef Shoaib [MOD]
04/14/2023, 7:51 PMfun EagerEffectScope<...>.fetchUser
still suspend though, no? The difference is that it'd be restricted suspension.simon.vergauwen
04/14/2023, 8:25 PMOliver Eisenbarth
04/15/2023, 2:53 PM