<div dir="ltr">Do we have any other good examples where we've got an operator that is considered associative where the result type isn't identical to the argument types? It's much more common to allow the types to vary when there's only one associativity that makes sense for the way an operator is intended to be used.<div><br></div><div><font face="monospace">a -> a -> a<br></font><div><br></div><div>While it's true that focusing on Bool, (==) satisfies associativity in its truth table, the types don't work out so cleanly. Outside of Bool it starts to matter which associativity you pick.</div><div><br></div><div>





<p class="inbox-inbox-p1"><span style="font-family:monospace">(\x y z -> (x == y) == z) :: Eq a => a -> a -> Bool -> Bool</span><br></p>
<p class="inbox-inbox-p2"><span style="font-family:monospace">(\x y z -> x == (y == z)) :: Eq a => Bool -> a -> a -> Bool</span><br></p></div><div><br></div><div>Making == associative is just going to lead to harder to understand code and will require people to memorize which arbitrary choice about the associativity of the operation was selected by the mailing list in order to make sense of the types of code using multiple ==.</div><div><br></div><div>I see no gain here, and I'd prefer to leave == as is.</div><div><br></div><div>Best regards,</div><div>Eric Mertens</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 18, 2018 at 2:34 AM C Maeder <<a href="mailto:chr.maeder@web.de">chr.maeder@web.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
infixr seeems right for an equivalence (==) since implication is usually<br>
also right associative.<br>
<br>
Implication "==>" corresponds to "<=" on Bool, which might be confusing.<br>
Reverse implication (>=) should be left associative, then.<br>
<br>
Cheers Christian<br>
<br>
Am 17.09.2018 um 11:28 schrieb Dannyu NDos:<br>
> Well, infixr is friendlier to parsers.<br>
> <br>
> 2018년 9월 17일 (월) 오후 6:22, David Feuer <<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a><br>
> <mailto:<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>>>님이 작성:<br>
> <br>
>     Looks good to me! Do you have an opinion about infixl vs infixr?<br>
> <br>
>         Libraries mailing list<br>
>         <a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a> <mailto:<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a>><br>
>         <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> Libraries mailing list<br>
> <a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
> <br>
<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>