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:
- haskell-language-server (because IDE integration from the get-go is invaluable)
- ghcid (for instant auto-recompilation and re-running of the program)
treefmt (to keep the project tree autoformatted)
fourmolu1 for Haskell
- mission-control for devshell scripts and discovery
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).
Explain the usefulness
- To keep Nix code simple by modularizing orthogonal features. Especially in monorepos.
Nix itself may get a modue system for flakes. Unti then,
ormolubut switched to
fourmolubecause ormolu is annoying in some cases (like it throwing away multiline haddock comments)