
24 Apr
2010
24 Apr
'10
10:27 a.m.
On Sat, Apr 24, 2010 at 5:56 AM, Barak A. Pearlmutter
Even deriving(Ord) only produces compare and relies on standard definitions for other methods.
I don't think that's actually a problem. Surely the IEEE Floating Point types would give their own definitions of not just compare but also <, <=, etc, overriding the problematic deriving(Ord) definitions of comparison in terms of compare and vice-versa.
There is the issue of deriving Ord for algebraic types that include Float.
data Foo = Foo Float deriving (Show, Eq, Ord)
*Main> Foo (0/0) > Foo (0/0)
True
*Main> 0/0 > 0/0
False
If compare (0/0) (0/0) = _|_, then Foo (0/0) == Foo (0/0) = _|_.
--
Dave Menendez