doomemacs/modules/lang/haskell
Henrik Lissner 09cb4f6716
Major refactor & optimization of how modules load their packages
Now that we are loading package autoloads files (as part of the
generated doom-package-autoload-file when running make autoloads), many
:commands properties are redundant. In fact, many def-package! blocks
are redundant.

In some cases, we can do without a config.el file entirely, and can move
into the autoloads file or rely entirely on package autoloads.

Also, many settings have been moved in their module's autoloads files,
which makes them available ASAP; their use no longer depends on module
load order.

This gained me a modest ~10% boost in startup speed.
2018-05-25 00:46:16 +02:00
..
+dante.el Rewrite doctor; move warn! blocks out in doctor.el files 2018-03-12 13:32:01 -04:00
+intero.el General minor refactor & docstring fixes 2018-05-14 20:55:55 +02:00
config.el Major refactor & optimization of how modules load their packages 2018-05-25 00:46:16 +02:00
doctor.el Don't byte-compile doctor.el files 2018-03-20 21:19:37 -04:00
packages.el lang/haskell: fix ESC ESC keybind in REPL; move company-ghc to +dante 2018-03-01 01:12:23 -05:00
README.org lang/haskell: update README 2017-10-18 17:55:04 +02:00

:lang haskell

This module adds Haskell support, powered by either intero (the default) or dante.

  • Code completion (company-ghc)
  • Look up documentation (hoogle)
  • eldoc support (dante)
  • REPL (ghci)
  • Syntax-checking (flycheck)
  • Code navigation (dante)
  • Snippets

Haskell contends with C and Ruby as my favorite language. My Haskell code will never save the world, but I'll reach for it for small projects and programming exercises (like projecteuler.com or exercism.io).

I'd love to incorporate it into my machine learning work, but Python and Julia hold that crown. For now.

Table of Contents   TOC

Install

This module has two submodules: Intero or Dante. To activate one, specify one or the other in your pubilc init.el, e.g.:

(doom! :lang (haskell +intero))
;; or
(doom! :lang (haskell +dante))

Your dependencies will change slightly, depending on which you choose:

Intero

Haskell

To get started you must install stack:

MacOS
brew install haskell-stack
stack setup
Arch Linux
sudo pacman --needed --noconfirm -S stack
# Replace pacaur with your AUR package manager of choice
pacaur --needed --noconfirm -S ncurses5-compat-lib
stack setup

External dependencies

This module requires ghc-mod.

stack install ghc-mod

Also ensure that \~/.local/bin is in PATH:

# place this in your profile file, like ~/.bash_profile or ~/.zshenv
export PATH="~/.local/bin:$PATH"

Dante

Haskell

To get started with Dante and Haskell, you must install cabal

  • cabal (the haskell package builder)
  • ghc/ghci (the compiler, syntax checker & repl)
MacOS
brew install cabal-install ghc
Arch Linux
sudo pacman --needed --noconfirm -S cabal-install ghc

External dependencies

Dante requires ghc-mod and hoogle:

cabal update
cabal install happy haskell-src-exts   # ghc-mod/hoogle dependencies
cabal ghc-mod hoogle

And add Cabal's bin path to $PATH:

export PATH="$HOME/.cabal/bin:$PATH"

Troubleshooting

  • Stack users: a dist/setup-config in your project may cause ghc-mod to not work.

Resources

Here are a few resources I've found indespensible in my Haskell adventures: