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.
- Install Stack
- Install sandboxed GHC and dependencies
stack setup stack build --dependencies-only --test
- Install tools
stack build intero stack install apply-refact codex hasktags hlint codex set format emacs
This might take a while.
- Move any preexisting Emacs configurations
for f in ~/.emacs*; do if [ -e "$f" ]; then echo "Moving config to $f.orig" mv "$f" "$f.orig" fi done
- Use this project’s configuration
cp -r emacs.d ~/.emacs.d
- (Re)start Emacs
It will take up to a couple of minutes for Emacs to download and compile all dependencies.
- Follow the tutorial