[Haskell-cafe] Any precedent or plan for guaranteed-safe Eq and Ord instances?
Wed Oct 2 13:49:44 UTC 2013
Only for meanings of "better" which do not imply as good performance.
On 2 October 2013 14:46, Stijn van Drongelen <rhymoid at gmail.com> wrote:
> I do think something has to be done to have an Eq and Ord with more strict
> * Operators in Eq and Ord diverge iff any of their parameters are bottom.
> * The default definitions of (/=), (<), (>) and `compare` are law.
> * (==) is reflexive and transitive
> * (<=) is antisymmetric ((x <= y && y <= x) `implies` (x == y))
> * (<=) is 'total' (x <= y || y <= x)
> * (<=) is transitive
> Currently, reflexivity of (==) is broken in the Prelude (let x = 0/0 in x
> == x). I know this is for IEEE 754 compliance, but c'mon, this is Haskell,
> we can have better ways of dealing with NaNs.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe