<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">+1 to Eric's argument here. I would prefer to leave these fixities out. Of course, defining Bool-specific instantiations with fixities is a fine idea.<div class=""><br class=""></div><div class="">Richard<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 18, 2018, at 11:34 AM, Eric Mertens <<a href="mailto:emertens@gmail.com" class="">emertens@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">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 class=""><br class=""></div><div class=""><font face="monospace" class="">a -> a -> a<br class=""></font><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class=""><p class="inbox-inbox-p1"><span style="font-family:monospace" class="">(\x y z -> (x == y) == z) :: Eq a => a -> a -> Bool -> Bool</span><br class=""></p><p class="inbox-inbox-p2"><span style="font-family:monospace" class="">(\x y z -> x == (y == z)) :: Eq a => Bool -> a -> a -> Bool</span><br class=""></p></div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">I see no gain here, and I'd prefer to leave == as is.</div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Eric Mertens</div><div class=""><br class=""></div></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Sep 18, 2018 at 2:34 AM C Maeder <<a href="mailto:chr.maeder@web.de" class="">chr.maeder@web.de</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br class="">
<br class="">
infixr seeems right for an equivalence (==) since implication is usually<br class="">
also right associative.<br class="">
<br class="">
Implication "==>" corresponds to "<=" on Bool, which might be confusing.<br class="">
Reverse implication (>=) should be left associative, then.<br class="">
<br class="">
Cheers Christian<br class="">
<br class="">
Am 17.09.2018 um 11:28 schrieb Dannyu NDos:<br class="">
> Well, infixr is friendlier to parsers.<br class="">
> <br class="">
> 2018년 9월 17일 (월) 오후 6:22, David Feuer <<a href="mailto:david.feuer@gmail.com" target="_blank" class="">david.feuer@gmail.com</a><br class="">
> <mailto:<a href="mailto:david.feuer@gmail.com" target="_blank" class="">david.feuer@gmail.com</a>>>님이 작성:<br class="">
> <br class="">
>     Looks good to me! Do you have an opinion about infixl vs infixr?<br class="">
> <br class="">
>         Libraries mailing list<br class="">
>         <a href="mailto:Libraries@haskell.org" target="_blank" class="">Libraries@haskell.org</a> <mailto:<a href="mailto:Libraries@haskell.org" target="_blank" class="">Libraries@haskell.org</a>><br class="">
>         <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank" class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br class="">
> <br class="">
> <br class="">
> <br class="">
> _______________________________________________<br class="">
> Libraries mailing list<br class="">
> <a href="mailto:Libraries@haskell.org" target="_blank" class="">Libraries@haskell.org</a><br class="">
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank" class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br class="">
> <br class="">
<br class="">
_______________________________________________<br class="">
Libraries mailing list<br class="">
<a href="mailto:Libraries@haskell.org" target="_blank" class="">Libraries@haskell.org</a><br class="">
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank" class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br class="">
</blockquote></div>
_______________________________________________<br class="">Libraries mailing list<br class=""><a href="mailto:Libraries@haskell.org" class="">Libraries@haskell.org</a><br class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries<br class=""></div></blockquote></div><br class=""></div></body></html>