Why are the monad comprehensions like `option` or ...
# arrow
r
Why are the monad comprehensions like
option
or
either
suspend functions? Wouldn’t they work just as well without suspend?
s
Is them being suspend functions a problem for some reason? Have you tried
option.eager
or
either.eager
? Those are not suspending.
r
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
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.