Desugaring do-notation to Applicative

Jake McArthur jake.mcarthur
Wed Oct 2 11:48:49 UTC 2013


That isn't the only point. Applicative is also more general than Monad, in
that more things are Applicatives than they are Monads, so this would
enable to use a limited form of do-notation in more code. Also, Applicative
interfaces are more amenable to some static optimizations, since the
effects of an entire applicative expression can be known statically.

- Jake


On Wed, Oct 2, 2013 at 5:12 AM, <p.k.f.holzenspies at utwente.nl> wrote:

>  I thought the whole point of Applicative (at least, reading Connor?s
> paper) was to restore some function-application-style to the whole
> effects-thing, i.e. it was the very point **not** to resort to binds or
> do-notation.****
>
> ** **
>
> That being said, I?m all for something that will promote the use of the
> name ?pure? over ?return?.****
>
> ** **
>
> +1 for the Opt-In****
>
> ** **
>
> Ph.****
>
> ** **
>
> ** **
>
> ** **
>
> *From:* Glasgow-haskell-users [mailto:
> glasgow-haskell-users-bounces at haskell.org] *On Behalf Of *Iavor Diatchki
>
> ****
>
> ** **
>
> do x1 <- e1****
>
> ** **
>
>    -- The following part is `Applicative`****
>
>    (x2,x3) <- do x2 <- e2 x1****
>
>                  x3 <- e3****
>
>                  pure (x2,x3)****
>
> ** **
>
>    f x1 x2 x3****
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20131002/f5a3dbe0/attachment.html>



More information about the Glasgow-haskell-users mailing list