[Haskell-cafe] Re: Why purely in haskell?
lennart at augustsson.net
Fri Jan 11 10:11:53 EST 2008
If you talk to anyone who uses floating point numbers for real they would
find (0/0)==(0/0) perfectly natural.
It disobeys some axioms that Eq instances don't fulfill anyway, but changing
it would make a lot of people surprised too.
In general, the floating point instances break almost all axioms that you
might think exist for numbers.
On Jan 11, 2008 1:27 AM, Wolfgang Jeltsch <g9ks157k at acme.softbase.org>
> Am Freitag, 11. Januar 2008 08:11 schrieb Lennart Augustsson:
> > Some people seem to think that == is an equality predicate.
> > This is a big source of confusion for them; until they realize that ==
> > just another function returning Bool they will make claims like
> > [1..]==[1..] having an unnatural result.
> > The == function is only vaguely related to the equality predicate in
> > it is meant to be a computable approximation of semantic equality (but
> > since it's overloaded it can be anything, of course).
> > -- Lennart
> But class methods are expected to fulfill some axioms. I'd suppose that
> should be an equivalence relation. Of course, this is not implementable
> because of infininte data structures. But one could relax the axioms such
> that it's allowed for (==) to return _|_ instead of the expected value.
> Differentiating between data and codata would of course be the better
> However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking.
> doesn't adhere to any meaningful axiom set for Eq. So I think that this
> behavior should be changed. Think of a set implementation which uses (==)
> compare set elements for equality. The NaN behavior would break this
> implementation since it would allow for sets which contain NaN multiple
> Best wishes,
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe