[Haskell-cafe] 0/0 > 1 == False

Mitar mmitar at gmail.com
Wed Jan 16 21:16:48 EST 2008


Hi!

On Jan 11, 2008 7:30 AM, Cristian Baboi <cristi at ot.onrc.ro> wrote:
> NaN is not 'undefined'

Why not? What is a semantic difference? I believe Haskell should use
undefined instead of NaN for all operations which are mathematically
undefined (like 0/0). NaN should be used in a languages which does not
support such nice Haskell features. Because if Haskell would use
undefined such error would propagate itself to higher levels of
computations, with NaN it does not.

if bigComputation > 1
  then ...
  else ...

Would be evaluating else semantically correct if bigComputation
returns NaN? No, it is not. With undefined this is correctly
(not)evaluated.


Mitar


More information about the Haskell-Cafe mailing list