Redefining built in syntax

Simon Peyton-Jones simonpj at
Fri Jan 4 06:23:48 EST 2008

| C:\Documents\Uni\packages\base>ghci Prelude.hs -i -cpp -fglasgow-exts
| -package-name base
| GHCi, version 6.8.1:  :? for help
| <interactive>:1:22:
|     Failed to load interface for `System.IO':
|       it is not a module in the current program, or in any known package.

I don't think we'd ever thought of doing this.  In particular, I don't think we'd every considered using GHCi in combination with -package-name.

Furthermore, I'm not sure we've ever thought what should happen if you use -package-name foo, when compiling with a compiler that already has a package 'foo' (with an identical name) installed.  Probably we should check for this case, because it looks likely to lead to confusion.

The immediate problem is that GHCi looks for the value "System.IO.stdout" so that it can use it to print things, and it can't find module System.IO, I think because you've overridden the base-package binding.

Do you have to use GHCi for this stuff?  It's delicate, because GHCi prints things, but you want to compile the very functions it is using to do the printing...


More information about the Glasgow-haskell-users mailing list