Haskell
Templates
Templates provide extensive information about setting up development environment and packaging Haskell apps.
Tools
ghcid
ghcid is a Very low feature GHCi based IDE.
It can be used to re-run a function in a given file on changes in a given directory.
This template provides a sample configuration for this tool in the .ghcid file.
hpack
hpack translates package.yaml into .cabal.
Nix
haskell4nix
- haskell4nix
- nixpkgs manual
- Incrementally package a Haskell program
- haskell-nix - examples of packaging haskell apps
- Nixpkgs support for incremental Haskell builds
- Hackage packages in nixpkgs - Haskell packages
- Fixing broken Haskell packages in Nixpkgs
- Horizon Haskell
haskell.nix
- haskell.nix
- tutorial
- projects: discord-emoji-dl
Stack
Uses haskell4nix.
Stack support Nix integration.
Stack uses nix-shell.
- docs.
The name of the file providing a Nix shell can be customized in stack.yaml.
Here's the format of that file - docs.
The shell file can import the contents of flake.nix via flake-compat.
flake.nix provides an output stack-shell.${system} = {version}: ....
stack.nix imports flake.nix and provides a shell.
devShells
Completions for CLI apps
devShells.default = pkgs.mkShell {
    buildInputs = [ packageExe ];
    shellHook = ''
      source ${packageExe}/share/bash-completion/completions/${packageExecutableName}
    '';
  };
Troubleshooting
Haskell Language Server
Clear cache
Sometimes, HLS finds errors in code despite cabal build running successfully.
If you use VS Code, find Outputs of Haskell Language Server and determine the cache directory for a project.
It should have approximately this form: /home/<user name>/.cache/hie-bios/dist-<project-name>-<something>.
Remove it and restart HLS.