haskell.md

 1---
 2title: Haskell
 3description: "Configure Haskell language support in Zed, including language servers, formatting, and debugging."
 4---
 5
 6# Haskell
 7
 8Haskell support is available through the [Haskell extension](https://github.com/zed-extensions/haskell).
 9
10- Tree-sitter: [tree-sitter-haskell](https://github.com/tree-sitter/tree-sitter-haskell)
11- Language Server: [haskell-language-server](https://github.com/haskell/haskell-language-server)
12
13## Installing HLS
14
15Recommended method to [install haskell-language-server](https://haskell-language-server.readthedocs.io/en/latest/installation.html) (HLS) is via [ghcup](https://www.haskell.org/ghcup/install/) (`curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
16`):
17
18```sh
19ghcup install hls
20which haskell-language-server-wrapper
21```
22
23## Configuring HLS
24
25If you need to configure haskell-language-server (hls) you can add configuration options to your Zed settings.json:
26
27```json [settings]
28{
29  "lsp": {
30    "hls": {
31      "initialization_options": {
32        "haskell": {
33          "formattingProvider": "fourmolu"
34        }
35      }
36    }
37  }
38}
39```
40
41See the official [configuring haskell-language-server](https://haskell-language-server.readthedocs.io/en/latest/configuration.html) docs for more options.
42
43If you would like to use a specific hls binary, or perhaps use [static-ls](https://github.com/josephsumabat/static-ls) as a drop-in replacement instead, you can specify the binary path and arguments:
44
45```json [settings]
46{
47  "lsp": {
48    "hls": {
49      "binary": {
50        "path": "static-ls",
51        "arguments": ["--experimentalFeatures"]
52      }
53    }
54  }
55}
56```