Using functions from package haskell98 - GHC 5.04
Hi, I'm using ghc version 5.04 and I'm having a problem using functions from standard packages like "base" and "haskell98" For example In my program, I use the function "isDigit", which is part of haskell98.Data.Char When compiling my program, I get the error: Variable not in scope: isDigit. The same error occurs when I explicitly use the package haskell98 as in the following command-line. "ghc program.hs -package lang -package haskell98 -package data -fasm -fglasgow-exts -fallow-undecidable-instances -O2 --make -o program.exe" When trying to load this program in Hugs, there is nog problem at all. Am I doing something wrong, or is this a bug in ghc? Marco
"Marco van Roshum" <mvroshum@foqus-ict.com> writes:
In my program, I use the function "isDigit", which is part of haskell98.Data.Char
When compiling my program, I get the error: Variable not in scope: isDigit. The same error occurs when I explicitly use the package haskell98 as in the following command-line.
Are you remembering to add "import Data.Char" to your program?
When trying to load this program in Hugs, there is nog problem at all.
IIRC, the current release of Hugs has the function isDigit in the Prelude, and so doesn't need any imports. (This will change in the new October 2002 release.) Regards, Malcolm
On Tuesday, 2002-10-22, 11:28, CEST, Malcolm Wallace wrote:
[...]
IIRC, the current release of Hugs has the function isDigit in the Prelude, and so doesn't need any imports. (This will change in the new October 2002 release.)
It hasn't changed. Obviously, RC1 has it still in the prelude: Hugs session for: /usr/lib/hugs/lib/Prelude.hs Type :? for help Prelude> :t isDigit isDigit :: Char -> Bool And if it would have changed, AFAICS, Hugs would have to support mutually recursive modules. Then the man page would be wrong because it says that Hugs doesn't support them.
Regards, Malcolm
Wolfgang
On Tue, Oct 22, 2002 at 04:11:17PM +0200, Wolfgang Jeltsch wrote:
On Tuesday, 2002-10-22, 11:28, CEST, Malcolm Wallace wrote:
IIRC, the current release of Hugs has the function isDigit in the Prelude, and so doesn't need any imports. (This will change in the new October 2002 release.)
It hasn't changed. Obviously, RC1 has it still in the prelude:
Not if you give hugs the +N option, which switches it to a new library setup (which also includes lots of the hierarchical modules distributed with GHC, but is mostly backward compatible).
And if it would have changed, AFAICS, Hugs would have to support mutually recursive modules. Then the man page would be wrong because it says that Hugs doesn't support them.
It's done without mutually recursive modules: both Prelude and Char import Hugs.Prelude, but only export what they're supposed to. (And Hugs treats modules imported by the Prelude as internal things that don't implicitly import the Prelude.)
participants (4)
-
Malcolm Wallace -
Marco van Roshum -
Ross Paterson -
Wolfgang Jeltsch