title: How do I set up IntelliJ to build Haskell projects with Stack?
body: <p>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.</p>
  
  <p>I used Stack to create and run a "Hello, World" Haskell program on the command line following the instructions in the Stack <a href="http://docs.haskellstack.org/en/stable/GUIDE/">User Guide</a>. Everything worked fine.</p>
  
  <p>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.</p>
  
  <p><a href="https://i.stack.imgur.com/GJjAa.png"><img src="https://i.stack.imgur.com/GJjAa.png" alt="enter image description here"></a></p>
  
  <p>I can run the project using a Haskell Stack Run configuration. The console output is correct.</p>
  
  <pre><code>/Users/williammcneill/Library/Haskell/bin/stack exec hellohaskell-exe --
  Hello, Haskell.
  </code></pre>
  
  <p>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.</p>
  
  <p>The Project Settings->Artifacts tab has nothing listed, and I don't see a way to add a Haskell executable here.</p>
  
  <p>My workaround is to build my Haskell programs from the command line even when I'm editing from the IDE.</p>
  
  <p>(It also looks strange to me to specify a path to a project-specific <code>stack.yaml</code> file in the general Haskell compiler settings, but that was the only way I could see how to use Stack to build.)</p>
  
  <p>How do I set up IntelliJ to build Haskell projects using Stack?</p>
  
  <p><em>ghc 7.10.3, stack 1.1.2, HaskForce 0.3-beta.33, IntelliJ IDEA Ultimate 2016.1.3, OS X 10.11.5</em></p>
  
  <hr>
  
  <p>This is Haskforce <a href="https://github.com/carymrobbins/intellij-haskforce/issues/282">issue 282</a>.</p>