<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">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>