[Haskell-cafe] monad subexpressions

Simon Peyton-Jones simonpj at microsoft.com
Fri Aug 3 12:29:15 EDT 2007


|     f (g (<- mx))
|
| does this stand for
|
|     (a) mx >>= \x-> f (g x)
|     (b) f (mx >>= \x-> (g x))
|     (c) none of the above, because there's no do
|     (d) something else entirely

For me the answer is definitely (c).  Furthermore there must be no lambda between the "monadic splice" and the "do".

Given that, I think the meaning of a monadic splice is straightforward, and all your excellent questions have easy answers.  The question remains of whether or not it's valuable.

Simon



More information about the Haskell-Cafe mailing list