A tutorial for using Emacs with Haskell projects
Switch branches/tags
Nothing to show
Clone or download


Using Emacs with Haskell Projects


A tutorial about using Emacs to develop Haskell projects. Only basic Haskell and Emacs knowledge is required.

The tutorial attempts to cover several of the Emacs packages that one often uses when writing Haskell:

  • company
  • flycheck
  • haskell-mode
  • haskell-snippets
  • helm
  • hlint-refactor
  • intero
  • projectile
  • use-package
  • which-key
  • yasnippet

If you are new to Emacs, go through its tutorial first (press control+h followed by t).

This was originally presented for the “PDX Emacs Hackers” group. Some of the people attending were not Haskellers, hence the sparse section on basic Haskell.


Haskell Tools

  1. Install Stack
  2. Install sandboxed GHC and dependencies
    stack setup
    stack build --dependencies-only --test
  3. Install tools
    stack build intero
    stack install apply-refact codex hasktags hlint
    codex set format emacs

    This might take a while.


  1. Move any preexisting Emacs configurations
    for f in ~/.emacs*; do
      if [ -e "$f" ]; then
        echo "Moving config to $f.orig"
        mv "$f" "$f.orig"
  2. Use this project’s configuration
    cp -r emacs.d ~/.emacs.d
  3. (Re)start Emacs

    It will take up to a couple of minutes for Emacs to download and compile all dependencies.

  4. Follow the tutorial