Search code examples
haskellghcihaskell-stack

Use different configuration for "ghci" and "stack ghci"


I often use ghci for little calculations and stack ghci to work on my actual projects.

To make the first easier I have written a .ghci file with a lot of imported modules in it, but some of these modules aren't present in my stack project and I get nasty errors.

At the moment I use a alias stackghci="stack ghci --ghci-options -ignore-dot-ghci", but then I have the default prompt again and so on..

Is there a way of specifying two .ghci files; one for stack and one for ghci?


Solution

  • ghci supports the --ghci-script flag for specifying additional scripts to read at startup.

    Docs for --ghci-script: (link)