+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster startup; ~5-20% general boost + reduce consing, function calls & garbage collection by preferring cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and various cl-lib filter/map/reduce functions) -- where possible + prefer functions with dedicated opcodes, like assq (see byte-defop's in bytecomp.el for more) + prefer pcase & cond (faster) over cl-case + general refactor for code readability + ensure naming & style conventions are adhered to + appease byte-compiler by marking unused variables with underscore + defer minor mode activation to after-init, emacs-startup or window-setup hooks; a customization opportunity for users + ensures custom functionality won't interfere with startup. |
||
---|---|---|
.. | ||
config.el | ||
packages.el | ||
README.org |
: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