It strikes me that every monad comprehension ends in a return
. Does that not effectively make them isomorphic to applicative programming? Why do we have monad comprehensions with a Monad
constraint instead of applicative comprehensions with an Applicative
constraint?
This do-like notation for Applicative similarly strikes me as very similar to monad comprehensions.
No. You can write bind with monad comprehensions:
m >>= f == [ b | a <- m, b <- f a ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With