Proposal: New Eq and Ord instances for Double and Float

Daniel Peebles pumpkingod at gmail.com
Mon Sep 26 07:28:10 CEST 2011


How much correct code relies on the output of comparisons with NaN? The only
thing I can think of is when you're trying to reimplement isNaN.

On Mon, Sep 26, 2011 at 1:23 AM, Edward Kmett <ekmett at gmail.com> wrote:

> I too am against this proposal.
>
> I'd be for it for consistency if perhaps we were writing a language from
> scratch, because it has the transitive effect that one can't use pointer
> equality to short circuit structural equality checks anywhere the types
> involved are parametric or contain Floats, but it would subtly and silently
> break a good deal of existing code.
>
> -Edward
>
> Sent from my iPad
>
> On Sep 26, 2011, at 1:05 AM, "Bryan O'Sullivan" <bos at serpentine.com>
> wrote:
>
> On Sun, Sep 25, 2011 at 10:53 PM, Daniel Fischer <<daniel.is.fischer at googlemail.com>
> daniel.is.fischer at googlemail.com> wrote:
>
>> Proposal: Provide Double and Float with Eq and Ord instances that
>> introduce
>> a total order.
>>
>
> I am strongly against this proposal, as it is in an area that is
> particularly poorly understood by most programmers (even experts). While the
> current behaviour may be undesirable from some points of view, at least it
> is consistent with most other programming languages - and this is one of the
> few areas where I think that's important.
>
> _______________________________________________
>
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20110926/4178c6b3/attachment.htm>


More information about the Libraries mailing list