
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

I wrote:
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
Oops, apologies, it turns out that this is correct for ghc, I just didn't include it in all the files that needed it. 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
participants (1)
-
Amanda Clare