[Haskell-beginners] Variable re-use

Alexey Shmalko rasen.dubi at gmail.com
Sun May 3 18:19:25 UTC 2015


On Sun, May 3, 2015 at 2:07 PM Stanislaw Findeisen <
stf.list.haskell at eisenbits.com> wrote:

> On 2015-04-28 12:15, Alexey Shmalko wrote:
> > I'm sorry, my example should've been:
> >
> > [1,2,3] >>= \a -> [a+1] >>= \a -> return a
>
> Or just:
>
> [1,2,3] >>= (return . (+1))
>

Or just:

[2,3,4]

The point of the example was to desugar original do notation and show there
are two `a`s involved.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150503/34935cec/attachment.html>


More information about the Beginners mailing list