I am using Stack to setup, build, and run my Haskell projects from the command line. I want to use IntelliJ as my IDE but am running into problems configuring Stack as my build tool.
I used Stack to create and run a "Hello, World" Haskell program on the command line following the instructions in the Stack User Guide. Everything worked fine.
I have the HaskForce plugin installed on IntelliJ. The Build, Execution, Deployment -> Compiler -> Haskell Compiler tab gives you a choice between building with Stack and building with Cabal. I selecte Build with stack and configured it like so.
I can run the project using a Haskell Stack Run configuration. The console output is correct.
/Users/williammcneill/Library/Haskell/bin/stack exec hellohaskell-exe --
Hello, Haskell.
However, I cannot figure out how to rebuild the project through the IDE. For example, if I change the output text and rerun the program, I still see the original "Hello, Haskell" output. Build -> Make Project | Make Module | Rebuild Project all do nothing.
The Project Settings->Artifacts tab has nothing listed, and I don't see a way to add a Haskell executable here.
My workaround is to build my Haskell programs from the command line even when I'm editing from the IDE.
(It also looks strange to me to specify a path to a project-specific stack.yaml
file in the general Haskell compiler settings, but that was the only way I could see how to use Stack to build.)
How do I set up IntelliJ to build Haskell projects using Stack?
ghc 7.10.3, stack 1.1.2, HaskForce 0.3-beta.33, IntelliJ IDEA Ultimate 2016.1.3, OS X 10.11.5
This is Haskforce issue 282.