doomemacs/modules/lang/haskell
Henrik Lissner 037b018cdd
feat: add .doommodule files
These optional dotfiles indicate the root of a module or module
group (:lang), and will later contain module metadata. They will also
serve as an alternative to packages.el and doctor.el, and will aide the
parts of the v3.0 module API concerned with resolving the current module
from a path (`doom-module-from-path`), which currently rely too heavily
on parsing path strings.

For now, however, they're simply placeholders.
2024-09-14 20:47:39 -04:00
..
.doommodule feat: add .doommodule files 2024-09-14 20:47:39 -04:00
autoload.el fix(haskell): require haskell-interactive-mode when opening repl 2023-03-08 20:31:25 -05:00
config.el refactor(lsp): let lsp-mode load lsp client packages 2024-09-09 17:24:45 -04:00
doctor.el refactor: deprecate featurep! for modulep! 2022-08-14 20:43:35 +02:00
packages.el bump: :lang 2024-09-07 19:04:37 -04:00
README.org docs(*): replace all-the-icons with nerd-icons 2023-09-16 20:19:11 +02:00

:lang haskell

Description   unfold

This module adds Haskell support to Doom Emacs.

Module flags

+lsp
Enable LSP support for haskell-mode. Requires doom-module::tools lsp and a langserver (supports haskell-language-server).
+tree-sitter
Leverages tree-sitter for better syntax highlighting and structural text editing. Requires doom-module::tools tree-sitter.

Hacks

No hacks documented for this module.

Installation

Enable this module in your doom! block.

It is recommended to install the haskell tooling using ghcup. Only ghc is needed for basic functionality:

ghcup install ghc

but +lsp users should also install the language server:

ghcup install hls

Installing cabal or stack as well is recommended, and can be done through ghcup.

haskell-mode provides support for hoogle, which can be installed through system package manager, cabal, or stack.

haskell-language-server provides support for hlint, and haskell code formatters such as brittany, floskell, ormolu, fourmolu, and stylish-haskell, which can be installed through system package manager, cabal, or stack.

Formatter

doom-module::editor format by default uses fourmolu to format code when not relying on hls, follow the linked install instructions.

TODO Usage

󱌣 This module's usage documentation is incomplete. Complete it?

This module integrates the 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

TODO Configuration

󱌣 This module's configuration documentation is incomplete. Complete it?

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.:

;; ~/.doom.d/config.el
(after! lsp-haskell
  (setq lsp-haskell-formatting-provider "brittany"))

Troubleshooting

There are no known problems with this module. Report one?

Frequently asked questions

This module has no FAQs yet. Ask one?

TODO Appendix

󱌣 This module has no appendix yet. Write one?