I accidentally the Prelude

Jeremy Shaw jeremy at n-heptane.com
Tue Mar 2 10:46:24 EST 2010

I would still vote for that error in the 'worst ghc error message contest'.
I got it just last night with 6.13 when I tried to run the Setup.hs function
in base:

~/n-heptane/projects/haskell/darcs/base- $ rm Setup.o Setup.hi
~/n-heptane/projects/haskell/darcs/base- $ ghc --make -O2 Setup.hs -o
[1 of 1] Compiling Main             ( Setup.hs, Setup.o )

    attempting to use module `Prelude' (./Prelude.hs) which is not loaded
~/n-heptane/projects/haskell/darcs/base- $ runhaskell Setup.hs

    attempting to use module `Prelude' (./Prelude.hs) which is not loaded
~/n-heptane/projects/haskell/darcs/base- $

In this case it does at least mention the path to the troublesome file. But
I still have no idea why it is not loaded** (In this particular case I don't
want it loaded. Though I believe there are other similar situations where I

** well, from experience I know that it is 'not loaded' because it can't
decide if it should load the source, or use the version installed in the
package library. But the first time I saw the message, I was quite confused.
But, perhaps there are other cases when this error can occur?

- jeremy

On Tue, Mar 2, 2010 at 5:21 AM, Simon Marlow <marlowsd at gmail.com> wrote:

> On 02/03/2010 08:59, Josef Svenningsson wrote:
>> On Mon, Mar 1, 2010 at 11:54 PM, Jeremy Shaw<jeremy at n-heptane.com>
>>  wrote:
>>> is there, by chance, a file named Prelude.hs in the working directory?
>>> (the
>>> directory you are in when you type ghci?)
>>> - jeremy
>>>  Ah. Thanks! That was indeed the problem.
>> Though I think ghci:s response could be a little bit more transparent.
> Sure, how about this:
> $ touch Prelude.hs
> $ ghci
> GHCi, version 6.12.1: http://www.haskell.org/ghc/  :? for help
> Loading package ghc-prim ... linking ... done.
> Loading package integer-gmp ... linking ... done.
> Loading package base ... linking ... done.
> Loading package ffi-1.0 ... linking ... done.
> Prelude>
> ie. with 6.12.1 it just works.
> Cheers,
>        Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20100302/7b053c44/attachment.html

More information about the Glasgow-haskell-users mailing list