[Haskell-cafe] Re: instance Eq (a -> b)

Alexander Solla ajs at 2piix.com
Thu Apr 15 12:02:37 EDT 2010


On Apr 15, 2010, at 12:53 AM, roconnor at theorem.ca wrote:

> I'd call them disrespectful functions, or maybe nowadays I might  
> call them
> improper functions.  The "good" functions are respectful functions or
> proper functions.

There's no need to put these into a different class.  The IEEE defined  
this behavior in 1985, in order to help with rounding error.  Floats  
and doubles are NOT a field, let alone an ordered field.  0.0 =/= -0.0  
by design, for floats and doubles.  0.0 == -0.0 for integers, exact  
computable reals, etc.  The problem isn't the functions, or the Eq  
instance.  It's the semantics of the underlying data type -- or  
equivalently, expecting that floats and doubles form an ordered field.


More information about the Haskell-Cafe mailing list