> From: "Barak A. Pearlmutter" <ba...@cs.nuim.ie> > >> ... An invalid comparison evaluating to _|_ is arguably more >> correct, but I personally find the idea of introducing more bottoms >> rather distasteful. > > Too late! NaN is pretty much the _|_ of IEEE Floating Point. > > That was certainly the intent of the IEEE standard, and is why NaN is > so contagious. But they wanted to relax the usual strictness of their > languages (FORTRAN, C) when this particular _|_ is around. So NaN is > contagious through strict arithmetic (+, *, etc) like _|_. But it has > strange behaviour with respect to comparison. In the context of > Haskell, which does not have the issue of needing to relax strictness > just for NaN, I think the "right thing" would be to have compare give > _|_, and maybe also <, >, ==. After all, NaN is outside the carefully > defined total ordering of all other IEEE floating point values > including +/- Infinity.
+1 John _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe