On Wed, Oct 13, 2010 at 3:50 AM, Heinrich Apfelmus
<apfel...@quantentunnel.de> wrote:
>> Combined with >>= / >> you have multiple reading direction in the same
>> expression, as in
>>
>> expression      ( c . b . a ) `liftM` a1 >>= a2 >>= a3
>> reading order     6   5   4            1      2      3
>
> That's why I'm usually using  =<<  instead of  >>= .

Does it bother you that (=<<) is defined to be infixr 1, while (<$>)
and (<*>) are infixl 4? Or is that just me?

For instance, I might write the above expression as something like:

a3 =<< a2 =<< a . b . c <$> a1

But this still seems awkward, because it mixes different fixities and
I have to mentally regroup things when reading it. Right associativity
here does make a certain amount of sense for monads, but
left-associativity is consistent with plain function application and
feels more natural to me.

- C.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to