[Haskell-cafe] Fwd: extending Do notation
silvio.frischi at gmail.com
Tue May 20 21:57:31 UTC 2014
On 05/20/2014 11:19 PM, Brandon Allbery wrote:
> I have to admit, I thought that was deliberate; that is, that the
> proposal was a generalization of pattern guards.
The idea was to extend the "do" notation. So you will never be able to
use it for a toplevel declaration, and I originally used a different
Hmm the new notation is also ambiguous in a statement. What's supposed
to be the difference between.
exp <- exp === exp === stmt
pat <- exp === stmt
I guess the "<-" in patten guards is a bit miss leading too, as it has
nothing to do with monads. It should be a "=" (doesn't work of course)
or a "~". I guess the problem is that <- does two things which can be
1. (>>=) i.e. extract value from monad (what the new <- or ! should do)
2. Assign/Pattern match it. same as("=" in let, "<-" in Pattern guards)
too much chaos!
More information about the Haskell-Cafe