doomemacs/modules/lang/haskell
2017-05-25 20:09:36 +02:00
..
config.el lang/haskell: refactor + add company-ghc 2017-05-25 20:09:36 +02:00
packages.el lang/haskell: refactor + add company-ghc 2017-05-25 20:09:36 +02:00
README.org Update READMEs & add new ones 2017-05-25 20:09:12 +02:00

:lang haskell

This module adds Haskell support.

  • 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. I don't think my Haskell code will ever save the world, but I'll reach for it when working on smaller projects and programming exercises (like projecteuler.com or exercism.io).

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

Install

To get started with Haskell, you need:

  • 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

Dependencies

This module requires the following cabal packages:

  • happy (required by haskell-src-exts)
  • haskell-src-exts (required by ghc-mod & hoogle)
  • ghc-mod (for auto-completion)
  • hoogle (for documentation lookup)
cabal update
cabal install happy haskell-src-exts ghc-mod hoogle

Ensure that \~/.cabal/bin is in PATH:

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

Troubleshooting

  • Stack users: if a dist/setup-config file exists in your project, ghc-mod may refuse to work.

Resources

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