[Haskell-cafe] Set of reals...?

MR K P SCHUPKE k.schupke at imperial.ac.uk
Fri Oct 29 09:22:58 EDT 2004


>Double already has +Inf and -Inf; it's just that Haskell doesn't have
>(AFAIK) syntax to write them as constants.

	In the source for the GHC libraries it uses 1/0 for +Infinity
and -1/0 for -Infinity, so I assume these are the "official" way to do it.

Personally I would define nicer names:

	positiveInfinity :: Double
	positiveInfinity = 1/0

	negativeInfinity :: Double
	negativeInfinity = -1/0

Keean.


More information about the Haskell-Cafe mailing list