[Haskell-cafe] Fwd: extending Do notation

Evan Laforge qdunkan at gmail.com
Tue May 20 18:38:51 UTC 2014

On Tue, May 20, 2014 at 11:01 AM, silvio <silvio.frischi at gmail.com> wrote:
> We could call it (<- exp) instead of ({ exp }) if that makes everyone
> feel more confortable but I don't see a reason to restrict it to if and
> case. It can could go into any expression.

This extension has been proposed a number of times.  Also there are
haskell-like languages that implement it, e.g. using !expr.  Looks
like at least Idris does, maybe also elm or habit or whatever else.

I can't find the write up on the haskell wiki for (<- expr), but I
think the sticking point was how the desugaring should happen in
nested expressions, and ambiguity about which level the (>>=) should
happen at.  That said, Idris apparently wasn't bothered by this.

So perhaps the way forward is to find the old proposal (or make a new
one, if it's gone), and see if Idris's solution applies to haskell.

More information about the Haskell-Cafe mailing list