[Haskell-cafe] Re: Why purely in haskell?

Wolfgang Jeltsch g9ks157k at acme.softbase.org
Fri Jan 11 08:56:05 EST 2008

Am Freitag, 11. Januar 2008 13:21 schrieb jerzy.karczmarczuk at info.unicaen.fr:
> Ketil Malde:
> > Wolfgang Jeltsch:
> >> However, the fact that (0 / 0) == (0 / 0) yields False is quite
> >> shocking. It doesn’t adhere to any meaningful axiom set for Eq.
> >
> > Tough luck, but that's how floating point works, and what the
> > numericalists know, and possibly even love (although I have my
> > doubts).  Sanitizing this behavior would make Haskell less usable for
> > real-world numerical problems.
> >
> > As a compromise, what about an option to make NaN (and presumably the
> > infinities) cause an immediate exception?  (And, cetero censeo,
> > exceptions for Int overflow as well.)
> People, you are monsters.
> First, despite the *common, well known* truth that Haskell is not
> Mathematics, this illusion seems to be extremely persistent! Haskell is
> a victim -

I was arguing from a software technology point of view: if (==) yields false 
when comparing a value with itself, this can break code (like a set 
implementation) which relies on certain guarantees.  The fact that Haskell 
allows to define (==) rather arbitrarily doesn’t mean that the use of 
arbitrary definitions of (==) is what we want.  It’s just that the language 
is to weak to express axioms.

My impression is that staying close to math is good from a software technology 
point of view.  And it has the advantage of less confusion for the user.

> […]

> Then, I see here, and on some other lists some tendency to speculate on the
> numerics by people who really don't need it, and don't use it.

Even if I don’t use numerics, I do care about the Haskell language as a whole.

> […]

> I would suggest to Wolfgang Jeltsch a little more of reserve before making
> sharp categorical proposals concerning the fl. point computations (and
> also acknowledge that NaN is not a unique entity). It is easy to propose -
> in the name of "purity" to massacre existing structures; several religious
> sects and political doctrines were born in such a way. The result was
> usually horrible...

I don’t see what’s so extreme about suggesting that IEEE floating point 
comparison should maybe be a seperate operator.  And I think, it is really 
inappropriate to compare this to horrible sects and doctrines.  Do you really 
want to argue that someone who insists on a rather clean language is 
dangerous?  Than more or less everyone on this list would be dangerous—from a 
C programmer’s point of view.

> The Num hierarchy in Haskell is bad, we know it, especially for people who
> do some more formal mathematics. There are more interesting problems to
> solve than organising a crusade against IEEE, "illegalizing" the Ord
> instance for numbers, etc.

Please don’t suggest that “illegalizing” some Ord instance is similar to 
killing people out of religious motives.

> Jerzy Karczmarczuk

Best wishes,

More information about the Haskell-Cafe mailing list