<div dir="ltr"><div>I have following datatype for representing arbitrary computable numbers:</div><div><br></div><div>    newtype Computable = Inexact (Word -> Integer)</div><div><br></div><div>"Inexact" encapsulates Cauchy sequences.</div><div><br></div><div>min and max will halt:</div><div><br></div><div>    instance Ord Computable where</div><div>        min (Inexact f) (Inexact g) = Inexact (\n -> min (f n) (g n))<div>        max (Inexact f) (Inexact g) = Inexact (\n -> max (f n) (g n))</div><div><br></div><div>But comparison functions won't halt for same numbers:</div><div><br></div><div>        compare (Inexact f) (Inexact g) = go 0 where</div><div>            go n = compare (f n) (g n) <> go (n+1)</div><div><br></div><div>So in this case, it would be inappropriate to defaultly define min and max.</div><div><br></div><div>It would be nice if there was a function for alternately defining comparison functions:</div><div><br></div><div>    defaultLessThan :: Ord a => a -> a -> Bool</div><div>    defaultLessThan x y = x == y || x == min x y<br></div><div><br></div><div>Then we can let (<=) = defaultLessThan.</div><div><br></div><div>Also I have to mention that the "realAbs" function I suggested in January must be the following definition in this regard:</div><div><br></div><div>    realAbs x = max x (negate x)<br></div></div></div>