:lang haskell
A language that’s lazier than I am
1. Description
This module adds Haskell support, powered by LSP (haskell-language-server).
1.1. Module flags
- +lsp
- Enables LSP support for
haskell-mode
utilizing haskell-language-server. Requires :tools lsp.
1.2. Packages
2. Prerequisites
It is recommended to install the haskell tooling using ghcup. Only ghc is needed for basic functionality:
2.1. Cabal
To use Dante, you need cabal (the haskell package builder) and ghci (the compiler, syntax checker & repl):
2.2. Haskell packages
You’ll need to install the following packages using stack
or cabal
:
(Dante users) ghc-mod
hoogle
And ensure the binaries for these packages are in your PATH
, e.g.
3. TODO Usage
This module has no usage documentation yet. Write some?
This module integrates haskell packages into Doom by providing things such as REPL support, project root recognition, etc. It also provide the following keybindings:
Keybinding | Description |
---|---|
<localleader> b | Build the current cabal project |
<localleader> c | Visit the .cabal file of the current buffer |
<localleader> h | Toggle visibility of the form at point |
<localleader> H | hides all top level functions |
4. Configuration
After installing your preferred formatter, make sure to set lsp-haskell-formatting-provider to it.
Make sure to configure the lsp to use your perfered formatter, e.g.:
5. Troubleshooting
- Stack users: a
dist/setup-config
file in your project may cause ghc-mod to not work.
6. TODO Appendix
This module’s appendix is incomplete. Write more?
6.1. External resources
Here are a few resources I’ve found indispensable in my Haskell adventures:
- Learn you a haskell for great good
- Haskell Programming from first principles
- Awesome Haskell: an extensive list of haskell resources
- The Haskell Tool Stack docs