Rationals

Amanda Clare ajc99@aber.ac.uk
Thu, 26 Jul 2001 16:16:51 +0100


Does anyone know how I use Rationals in ghc? In nhc I can just write

let a = b % c 

But ghc-5.00.2 gives the error message "Variable not in scope: `%'"

I've looked through the documentation and can't find any reference to a
Rational library, or any other library that might have it. The package
"std" has a Ratio.hi in the lib/imports directory (std isn't described
in the documentation) but including this doesn't help - same error. 

The Haskell98 report says:
"In particular, the type Rational is a ratio of two Integer values, as
defined in the Rational library." 

Any ideas?

Amanda
--
Amanda Clare  http://users.aber.ac.uk/ajc99/
Tel: +44 (0)1970 621922  Fax: +44 (0)1970 622455
Dept. of Computer Science, University of Wales, Aberystwyth, SY23 3DB