
On Wed, Jan 28, 2009 at 5:28 PM, wren ng thornton
John Goerzen wrote:
wren ng thornton wrote: I wonder if you would consider submitting a patch to base? It seems that this is a sore problem there, and ideally should be dealt with properly in base.
As Bertram Felgenhauer says, it's not as easy as fixing base; the problem is an error in the Haskell98 specification. The Float and Double types contain exceptional values which cannot be represented in Rational (by definition). The only Haskell98 solution is to raise an error when attempting to convert those values into Rational, which isn't much of an improvement.
Is there a good reason why Rational is defined in a way that it can not represent Nan, Inf and -Inf? (Any other exceptional values I forgot?) Would fixing the definition so that it can represent those values be sufficient to fix this entire problem? Michael D. Adams mdmkolbe@gmail.com