Scaffolding for developing a Haskell project with Nix, niv, hpack, haskell-language-server, and Cabal 3.
Download this repo and add it to your PATH. To start a new project:
mkdir myprojectname && cd myprojectname
init-haskell
hpack && cabal run
Your editor can use haskell-language-server
to get language server analysis.
Note: the Cabal file must exist for this to work (so you need to generate it by running hpack
).
You can invoke the following in a terminal to get live error info:
ghcid
Requires Nix to be installed, gets everything else it needs through a Nix shell. You'll also want direnv
installed globally if you want to automatically be dropped into a shell with all the goodies, otherwise manually use nix-shell
.