1
votes

I have a .ghci file with configurations for a Haskell project in the directory Project. When I run ghci from the Mac terminal in the directory Project, ghci loads both the project's Project/.ghci file and the home directory ~/.ghci file. Is there a method to prevent the ~./ghci configurations from being loaded or have the Project/.ghci overwrite the ~./ghci configurations?

1
The project's .ghci should override the global one. Could you give an example of configurations that don't act how you expect? - 4castle
the :set prompt in Project/.ghci doesn't override the :set prompt in ~/.ghci - user7147804

1 Answers

2
votes

Unfortunately, this isn't how ghci works according to the docs. It loads all .ghci files in order, starting with the one in the current directory, which is why your prompt is taking on the value in your root .ghci rather than the one in the project.

You may have a better experience removing the .ghci files and using cabal new-build and cabal new-repl, assuming your project is Cabalized. This doesn't give you an option to set the prompt, but if that's an important element then you could always retain the .ghci at the project level and remove the global one. You'll still be able to specify available modules and extensions, though.