On Sat, Sep 21, 2013 at 5:28 PM, Bardur Arantsson <spam@scientician.net> wrote:> On 2013-09-21 23:08, Mike Meyer wrote:> > Exactly. The Eq and Ord instances aren't what's broken, at least when> > you're dealing with numbers (NaNs are another story). That there are pairs> According to Haskell NaN *is* a number.Trying to make something whose name is "Not A Number" act like anumber sounds broken from the start.> > Eq and Ord are just the messengers.> No. When we declare something an instance of Monad or Applicative (for> example), we expect(*) that thing to obey certain laws. Eq and Ord> instances for Float/Double do *not* obey the expected laws.I just went back through the thread, and the only examples I couldfind where that happened (as opposed to where floating pointcalculations or literals resulted in unexpected values) was withNaNs. Just out of curiosity, do you know of any that don't involveNaNs?Float violates the expected behavior of instances of - well, prettymuch everything it's an instance of. Even if you restrict yourself toworking with integer values that can be represented as floats. Ifwe're going to start removing it as an instance for violating instanceexpectations, we might as well take it out of the numeric stack (orthe language) completely.<mike
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe