2.1 KiB
2.1 KiB
: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 byhaskell-src-exts
)haskell-src-exts
(required byghc-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:
- Learn you a haskell for great good
- Haskell Programming from first principles
- Awesome Haskell: an extensive list of haskell resources