user2506946
user2506946

Reputation: 171

How to load custom dependencies in interactive Haskell-mode?

When using haskell-mode, I use C-c C-l to load the current file into repl/ghci and normally it works like magic. However, if I want to load a file from the test directory, ghci fails to load the dependencies (e.g. Test.Hspec) because those dependencies are defined in a different target (e.g. defined in the test target in my stack package.yaml).

So, how can I load the file with the correct dependencies?

From the terminal, I can correctly open stack ghci test/Myfile.hs which opens with all the correct dependencies. However, haskell mode runs stack ghci first and then tries to open the file with :load test/MyFile.hs. This secon approach fails because stack ghci loads with the dependencies for the defualt target.

So, how can I make haskell-mode run stack ghci test/Myfile.hs. Or at least allow me to pass a custom target?

Upvotes: 2

Views: 39

Answers (0)

Related Questions