Desugaring do-notation to Applicative

Reid Barton rwbarton
Wed Oct 2 18:13:10 UTC 2013


On Wed, Oct 2, 2013 at 1:50 PM, Edward Kmett <ekmett at gmail.com> wrote:

> That is admittedly a pretty convincing example that we may want to provide
> either a LANGUAGE pragma or a different syntax to opt in.
>

I suppose the Applicative desugaring can reliably be disabled by adding a
syntactic dependency on previous variables, like

    [ (x, y) | x <- [1..3], y <- const [1..10000000] x ]

so as far as I'm concerned it's sufficient if the Applicative desugaring is
opt-in on a per-module basis, without a separate syntax for Applicative vs
Monad do-notation/comprehensions. Those who opt in can be expected to
understand and deal with this sharing issue if it affects them. (They
pretty much have to understand it already, if they are compiling with
optimizations.)

Regards,
Reid Barton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20131002/dffc4693/attachment.html>



More information about the Glasgow-haskell-users mailing list