Skip to content

A tutorial for using Emacs with Haskell projects

Notifications You must be signed in to change notification settings

cydparser/demo-emacs-haskell

Repository files navigation

Using Emacs with Haskell Projects

About

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.

Setup

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.

Emacs

  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"
      fi
    done
        
  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

About

A tutorial for using Emacs with Haskell projects

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published