[Haskell-cafe] instance Enum Double considered not entirely great?

Maciej Marcin Piechotka uzytkownik2 at gmail.com
Wed Sep 21 00:38:12 CEST 2011


On Tue, 2011-09-20 at 16:05 -0600, Chris Smith wrote:
> On Tue, 2011-09-20 at 17:28 -0400, Casey McCann wrote:
> > Since removing the instances entirely is
> > probably not a popular idea, the least broken solution would be to
> > define NaN as equal to itself and less than everything else, thus
> > accepting the reality of Ord as the "meaningless arbitrary total
> > order" type class I suggested above and leaving Haskell bereft of
> any
> > generic semantic comparisons whatsoever. Ah, pragmatism.
> 
> There's nothing *wrong* with pragmatism, but in any case, we seem to
> agree on this.  As I said earlier, we ought to impose a (rather
> arbitrary) total order on Float and Double, and then offer comparison
> with IEEE semantics as a separate set of functions when they are
> needed.
> (I wonder if Ocaml-style (<.) and (>.) and such are used anywhere.)
> 
> 

Doesn't seems so:

http://www.haskell.org/hoogle/?hoogle=%3E.
http://www.haskell.org/hoogle/?hoogle=%3C.

+1 for:

class Eq a => IEEEEq a where
    (<.) :: a -> a -> Bool
    (>.) :: a -> a -> Bool

Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110921/ec990f97/attachment.pgp>


More information about the Haskell-Cafe mailing list