<div dir="auto">Does the wording of the report specify "totally ordered" as a law? I think it would be good to make that explicit, laying out the axioms for what a total order is—similar to the current documentation in Data.Ord but explicitly as the laws for the class.<div dir="auto"><br></div><div dir="auto">The relationship between Eq and Ord should be explicitly specified too, if it isn't.</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Feb 6, 2019, 12:53 Herbert Valerio Riedel <<a href="mailto:hvriedel@gmail.com">hvriedel@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><br><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 6, 2019 at 9:43 PM chessai . <<a href="mailto:chessai1996@gmail.com" target="_blank" rel="noreferrer">chessai1996@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Per GHC.Classes (haddock-viewable from Data.Ord)<br>
<br>
"The Haskell Report defines no laws for Ord. However, <= is<br>
customarily expected to implement a non-strict partial order and have<br>
the following properties:"<br>
<br>
I propose that in the next report that the expected typeclass laws for<br>
Ord be added. They're generally agreed upon/understood.<br></blockquote><div><br></div><div><br></div><div>Can you spell out the concrete change to the report wording you're suggesting? For reference, the current wording used in the 2010 Haskell Report is quoted below. While at it, you might also want to take into account the `Eq` class definition in the report.</div><div><br></div><div><br></div></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><div class="gmail_quote"><div><font size="4">6.3.2 The Ord Class</font></div></div></div></div><div><div><div class="gmail_quote"><div><br></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">  class  (Eq a) => Ord a  where  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">    compare              :: a -> a -> Ordering  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">    (<), (<=), (>=), (>) :: a -> a -> Bool  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">    max, min             :: a -> a -> a  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1"> </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">    compare x y | x == y    = EQ  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">                | x <= y    = LT  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">                | otherwise = GT  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1"> </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">    x <= y  = compare x y /= GT  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">    x <  y  = compare x y == LT  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">    x >= y  = compare x y /= LT  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">    x >  y  = compare x y == GT  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1"> </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">    -- Note that (min x y, max x y) = (x,y) or (y,x)  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">    max x y | x <= y    =  y  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">            | otherwise =  x  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">    min x y | x <= y    =  x  </font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace" size="1">            | otherwise =  y</font></div></div></div></div></div><div><div><div class="gmail_quote"><div><div><br></div></div></div></div></div><div><div><div class="gmail_quote"><div><div>The <font face="monospace, monospace">Ord</font> class is used for totally ordered datatypes. All basic datatypes except for functions, <font face="monospace, monospace">IO</font>, and <font face="monospace, monospace">IOError</font>, are instances of this class. Instances of <font face="monospace, monospace">Ord</font> can be derived for any user-defined datatype whose constituent types are in <font face="monospace, monospace">Ord</font>. The declared order of the constructors in the data declaration determines the ordering in derived <font face="monospace, monospace">Ord</font> instances. The <font face="monospace, monospace">Ordering</font> datatype allows a single comparison to determine the precise ordering of two objects.</div></div></div></div></div><div><div><div class="gmail_quote"><div><div><br></div></div></div></div></div><div><div><div class="gmail_quote"><div><div>The default declarations allow a user to create an <font face="monospace, monospace">Ord</font> instance either with a type-specific compare function or with type-specific <font face="monospace, monospace">==</font> and <font face="monospace, monospace"><=</font> functions.</div></div></div></div></div></blockquote><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div><br></div><div> </div></div>
</div></div></div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank" rel="noreferrer">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>