[Haskell] Literal for Infinity

Yitzchak Gale gale at sefer.org
Thu Sep 29 07:49:14 EDT 2005

While checking for floating-point overflow and
underflow conditions, I tried to create a somewhat
reliable cross-platform Infinity with the literal

When GHC 6.4.1 reads this literal, it goes into a
deep trance and consumes huge amounts of
memory. Shouldn't it immediately recognize such a
thing as Infinity?

Is there a better way to check for Infinity?  I
have not yet figured out how to check for NaN at
all - because it is not equal to itself. Any

BTW, I notice that Simon PJ proposed literals
for Infinity and Nan several years ago:


Did anything ever come out of this?


More information about the Haskell mailing list