<div dir="ltr"><div><div class="gmail_extra"><br class="">On Wed, Oct 2, 2013 at 4:17 PM, Tom Ellis <span dir="ltr"><<a href="mailto:tom-lists-haskell-cafe-2013@jaguarpaw.co.uk" target="_blank">tom-lists-haskell-cafe-2013@jaguarpaw.co.uk</a>></span> wrote:<br>
</div><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"></blockquote></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im" style="font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(34,34,34)">What's the benefit of this requirement, as opposed to, for example</span><br></div><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px"> False <= _ = True</span><br></blockquote><div class="gmail_extra"><br></div><div class="gmail_extra">I was trying to cover for void types, where the only sensible definitions are</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"> instance Eq Void where</div><div class="gmail_extra"> _ == _ = error "void (==)"</div><div class="gmail_extra"><br></div><div class="gmail_extra">
instance Ord Void where</div><div class="gmail_extra"> _ <= _ = error "void (<=)"</div><div class="gmail_extra"><br></div><div class="gmail_extra">This is because reflexivity must be guaranteed, so undefined == undefined may not yield False, but I doubt error "foo" == (let x = x in x) should yield True either. But perhaps this exception deserves its own rule.</div>
</div><div class="gmail_extra"><br></div>On Wed, Oct 2, 2013 at 5:36 PM, Roman Cheplyaka <span dir="ltr"><<a href="mailto:roma@ro-che.info" target="_blank">roma@ro-che.info</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">* Stijn van Drongelen <<a href="mailto:rhymoid@gmail.com">rhymoid@gmail.com</a>> [2013-10-02 15:46:42+0200]<br>
<div class="im">> I do think something has to be done to have an Eq and Ord with more strict<br>
> laws.<br>
><br>
> * Operators in Eq and Ord diverge iff any of their parameters are bottom.<br>
<br>
</div>This outlaws the Eq instances of lists, trees, and other (co)recursive<br>
types.<br>
<br>
Furthermore, in this formulation, even Eq for tuples is illegal, because<br>
<br>
(undefined, something) == somethingElse<br>
<br>
is going to diverge.<br>
<span class=""><font color="#888888"><br>
Roman<br>
</font></span></blockquote></div><br></div><div class="gmail_extra">I knew this was going to bite me in the ass. Let me try again:<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">* Operators in Eq and Ord may only diverge when any of their parameters are bottom.</div>
</div>