[Haskell-cafe] Smarter do notation

Sebastian Fischer fischer at nii.ac.jp
Sun Sep 4 13:16:37 CEST 2011


On Sun, Sep 4, 2011 at 11:34 AM, Daniel Peebles <pumpkingod at gmail.com> wrote:
> I was wondering what people thought of a smarter do notation.

I'd support it (for both do notation and monad comprehensions) once
Applicative is a superclass of Monad.

To me it looks light a slight complication for an advantage. Parsers
are not the only examples that benefit. Implicitly parallel
computations would be another because the arguments of <*> can be
evaluated in parallel, those of >>= cannot.

I think it's quite reasonable to try to desugar into the most general
form. Something like

    do x <- something
       return (bla x)

could (and, I think, should) be desugared by using only Functor.

Sebastian



More information about the Haskell-Cafe mailing list