The Haskell stack build doesn't install ghc to the system, only for itself, and using spacemacs without a systemwide configured ghc have been a painful experience (to me).

My question is, there is a correct way of configuring emacs/spacemacs for using with stack, or users are supposed to install a systemwide ghc and stack to work with emacs/spacemacs and haskell?

Creating a layer specific to deal with stack seems to me to be the right solution, but I don't know how to do this, I'm a beginner on both stack and emacs, so...

  • You might try settting system-ghc: true in your Stack config.yaml. – Soham Chowdhury Feb 3 '17 at 7:40
  • Hm, that will install ghc system wide from stack or inform stack that ghc is also installed system wide? I ask because I only have an stack ghc installed. – flavio Feb 3 '17 at 11:31
  • It tells Stack to find a globally-installed GHC. – Soham Chowdhury Feb 3 '17 at 11:46

I use intero for programming Haskell in Emacs. It has superior stack support. Check it out at its homepage.


Spacemacs already have the Haskell layer.

This layer has the following dependencies:

  • apply-refact (required by hlint-refactor)
  • hlint (required by hlint-refactor)
  • stylish-haskell (optional for haskell-mode)
  • hasktags (optional)
  • hoogle (optional for haskell-mode and helm-hoogle)
  • ghc-mod (optional for completion)
  • intero (optional for completion)

You can install them all with the following command (or the stack equivalent):

$ cabal install apply-refact hlint stylish-haskell hasktags hoogle

It also has the following syntax checkers:

  • flycheck
  • hlint (via flycheck)
  • ghc-mod
  • haskell-mode interactive
  • The haskell layer works well with a system install of haskell, but the question is how to do a good suport for the haskell Stack. The haskell layer doesn't do a good job on the interactive mode without having ghc installed system wide – flavio Jun 20 '17 at 0:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.