Use opinionated base tools

I originally created haskell-template to serve as the base template for my Haskell Projects. As such, I wanted it to include by default the following:

  • Relude (because Prelude is dangerous)
  • haskell-language-server (because IDE integration from the get-go is invaluable)
  • ghcid (for instant auto-recompilation and re-running of the program)
  • hlint
  • treefmt (to keep the project tree autoformatted)
    • fourmolu 1 for Haskell
    • cabal-fmt for Cabal
    • nixpkgs-fmt for Nix

If it is not used in every repo, do not add it to the template

Things like tests are not in the template repo, because I personally do not use it in every project created off this repo. Instead, a workflow like “How to add tests” should be documented (eg.: Adding tests). The same goes for project documentation (which normally would use Emanote).

Keep Nix as simple as possible

I wish to keep all the Nix code (flake.nix) as small and simple as possible. This is why much of the Nix is delegated to haskell-flake. Consequently, it also becomes easier for the user to do some Nix-based Haskell workflows (I’m yet to document these).

I used to use ormolu but switched to fourmolu because ormolu is annoying in some cases (like it throwing away multiline haddock comments)
Links to this page