Question

GHCi crashes when I try to start it from my src directory because it has a Prelude.hs file. I am not sure why this is happening though because I've set NoImplicitPrelude and I am doing a 'import "base" Prelude'

Here is my ghci.conf:

:set -XNoImplicitPrelude -XPackageImports

import "base" Prelude

Here is the GHCi output:

GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.

Top level:
    attempting to use module `Prelude' (./Prelude.hs) which is not loaded
Was it helpful?

Solution

The problem is that GHCi is loading the Prelude package before even looking at your .ghci config. So you can fix the problem by running:

ghci -XNoImplicitPrelude

which you could alias to ghci in your shell.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top