On Wednesday 21 September 2011, 00:38:12, Maciej Marcin Piechotka wrote:
> +1 for:
> 
> class Eq a => IEEEEq a where
>     (<.) :: a -> a -> Bool
>     (>.) :: a -> a -> Bool
> 
> Regards

-1 for the class name, too easy to miscount the Es.

And perhaps it would be better to add the IEEE compliant(?) comparisons to 
the RealFloat class.

class (RealFrac a, Floating a) => RealFloat a where
    ...    -- lots of stuff we already have
    (==.) :: a -> a -> Bool
    (<.) :: a -> a -> Bool
    ...

However, I don't particularly like adding just a dot, that's too easily 
overlooked. On the other hand, I don't have a compelling idea either. 
(.==.), (.<.) would at least double the chances to spot the difference.

Anyway, +1 for an Ord instance with a total order (consistent with the 
natural order where applicable) and putting the IEEE comparisons somewhere 
else.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to