[Haskell-cafe] Re: (flawed?) benchmark : sort
Lennart Augustsson
lennart at augustsson.net
Wed Mar 12 15:58:20 EDT 2008
I'd say that any polymorphic code that assumes that x==y implies x=y is
broken.
But apart from that, floating point numbers break all kinds of laws that we
might expect to hold. Even so, they are convenient to have instances of
various classes.
On Wed, Mar 12, 2008 at 7:31 PM, Adrian Hey <ahey at iee.org> wrote:
> Remi Turk wrote:
> > I wouldn't bet on it either:
> >
> > Prelude> 0.0 == -0.0
> > True
> > Prelude> isNegativeZero 0.0 == isNegativeZero (-0.0)
> > False
> >
> > Although isNegativeZero might be considered a ``private,
> > "internal" interface that exposes implementation details.''
>
> Interesting example.
>
> So is the correct conclusion from this that all (polymorphic) code
> that assumes (x == y) = True implies x=y is inherently broken,
> or is just this particular Eq instance that's broken?
>
> Regards
> --
> Adrian Hey
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080312/f795768e/attachment.htm
More information about the Haskell-Cafe
mailing list