https://kotlinlang.org logo
#arrow
Title
# arrow
r

rednifre

08/07/2022, 9:35 AM
Why are the monad comprehensions like
option
or
either
suspend functions? Wouldn’t they work just as well without suspend?
s

Stylianos Gakis

08/07/2022, 9:48 AM
Is them being suspend functions a problem for some reason? Have you tried
option.eager
or
either.eager
? Those are not suspending.
r

rednifre

08/07/2022, 12:06 PM
No, I was just curious. I’m just starting with Arrow and did not know
option.eager
or
either.eager
. I’ll learn more about suspend to clear up some misconceptions I might have.
f

fabianhjr

08/17/2022, 3:53 PM
It has to do with lack of syntactical support from the language (scala for-comprehension get desugared to a chain of
flatMap
calls, haskell do-comprehenisons to binds(
>>=
)) and lack of support for macros/reflection to implement that syntactical feature despite the language not supporting it.
16 Views