[Haskell-beginners] return IO () vs. ()

Neil Jensen neilcjensen at gmail.com
Sun May 29 17:45:07 CEST 2011


On Sun, May 29, 2011 at 1:29 AM, Chaddaï Fouché <chaddai.fouche at gmail.com>wrote:

> On Sun, May 29, 2011 at 3:33 AM, Antoine Latter <aslatter at gmail.com>
> wrote:
> > I think you might have your parenthesis in the wrong spot.
> >
> > Instead of
> >
> >> x >>= (\a -> y a) >> z
> >
> > you probably want:
> >
> >> x >>= (\a -> y a >> z)
> >
> > Does that make sense?
> >
>
> No, that shouldn't change anything (except maybe performance, but not
> here), monads have a property close to associativity which means that
> changing the parenthesis shouldn't change the meaning of your code,
> you don't have to worry about that.
>
> --
> Jedaï
>

That's right Chaddaï, I was just able to do the following and it worked:

calcCUVs account >>=  (\cuvs -> saveCUVs account cuvs)

Thanks.
N.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110529/269404d8/attachment.htm>


More information about the Beginners mailing list