A dev container template for Haskell development.
| Component | Version |
|---|---|
| GHC | 9.6.7 |
| Cabal | 3.10.3.0 |
| Haskell Language Server (HLS) | 2.12.0.0 |
Shell: Zsh (default)
System tools: build-essential, curl, git, pkg-config, libffi-dev, libgmp-dev, libssl-dev, zlib1g-dev, direnv, socat, procps
VS Code extensions installed automatically:
- Haskell — HLS integration
- Haskell Syntax Highlighting
- GHCi
- direnv
- Error Lens
- EditorConfig
- Markdown All in One
- markdownlint
- Docker
- VS Code with the Dev Containers extension
- Click Use this template on GitHub to create a new repository from this template.
- Clone your new repository and open it in VS Code.
- When prompted, click Reopen in Container (or run the command
Dev Containers: Reopen in Container). - The container will build and run the post-creation setup automatically. This may take several minutes on first build.
.
├── .devcontainer/
│ ├── devcontainer.json # Dev container configuration
│ ├── docker-compose.yml # App services
│ ├── Dockerfile # Haskell toolchain setup
│ └── post-create.sh # Post-creation setup script
├── .editorconfig # Consistent editor formatting rules
└── .gitignore # Haskell, Cabal, and VS Code ignores
Changing GHC or HLS versions: Update the version variables in .devcontainer/Dockerfile and update the versions mentioned in .devcontainer/post-create.sh welcome message accordingly.
Changing Cabal version: Update BOOTSTRAP_HASKELL_CABAL_VERSION in .devcontainer/Dockerfile.
Adding Cabal packages as dependencies: Create a cabal.project and .cabal package file at the root of the repository after cloning the template.
Using direnv for per-project environment variables: Add a .envrc file to the project root. direnv is pre-installed and hooked into both Bash and Zsh.