On Feb 11, 2008 10:18 PM, Uwe Hollerbach <[EMAIL PROTECTED]> wrote:
> If I fire up ghci, import
> Data.Ratio and GHC.Real, and then ask about the type of "infinity", it
> tells me Rational, which as far as I can tell is Ratio Integer...?

Yes, Rational is Ratio Integer.  It might not be a good idea to import
GHC.Real, since it doesn't seem to be documented at
http://www.haskell.org/ghc/docs/latest/html/libraries/.  If you just
import Data.Ratio, and define

> pinf :: Integer
> pinf = 1 % 0

> ninf :: Integer
> ninf = (-1) % 0

Then things fail the way you expect (basically, Data.Ratio isn't
written to support infinity).  But it's really odd the way the
infinity from GHC.Real works.  Anyone have an explanation?

-- 
I'm doing Science and I'm still alive.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to