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

Chaddaï Fouché chaddai.fouche at gmail.com
Sun May 29 10:29:10 CEST 2011


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ï



More information about the Beginners mailing list