GHC saga

Originally written: December 15th, 2022

I've been writing Haskell for about two years now.

I've gone through some tooling changes in that time: I started out using VS Code with hlint, but for the majority of the time, I'd been using Vim with the ale plugin to leverage Language Server Protocol (LSP) features.

However, after working on some larger multi-people projects, I've decided I needed to invest some time to improve my Haskell setup. This was sorely needed after switching from a beloved but commercially unsupported Arch Linux to a M1 Mac where clashes over x86 and aarch64 binaries abound. Here's what I've learned:

  • Use ghcup to manage GHC / Stack / Haskell Language Server (HLS) versions.

  • (Advice current as of 12/15/2022): Use Stackage LTS 20.3 (GHC 9.2.5). Earlier versions may break on M1 Macs. For some reason that I haven't yet uncovered, HLS does not support this GHC version, so you can compile it for yourself using GHCUP: ghcup compile hls -g master --ghc 9.2.5

  • Use VS Code and the Haskell plugin. While running LSP on Vim yield you similar results, I was always annoyed that the suggestion messages were impossible to read in Vim due to its limited status bar. Using VS Code fixes this quite nicely. Managing import lists, filling in type signatures for you, better tagging support have all been a boon to my productivity.