From zero to a running Haskell project
Install one tool, create a project, pick a compiler, and build. The whole loop, in a few commands.
1. Install hx
hx is a single static binary. Install it with the one-line script:
curl -fsSL https://arcanist.sh/hx/install.sh | shIt is also available through Homebrew (brew install arcanist-sh/tap/hx), WinGet, Scoop, aqua, pkgx and Nix, or from source with cargo install --git https://github.com/arcanist-sh/hx hx-cli. Verify it:
hx --version2. Create a project
hx init my-app
cd my-appThis scaffolds a project with a deterministic, checksum-verified TOML lockfile. If you already have a Cabal or Stack project, hx reads your existing .cabal file directly — there is nothing to migrate.
3. Pick a compiler
By default hx uses your managed GHC toolchain. To build with the Basel Haskell Compiler instead, pick the backend:
hx build # GHC (default)
hx build --backend bhc # BHCTo make BHC the default and choose a runtime profile, set it in hx.toml:
[compiler]
backend = "bhc"
[compiler.bhc]
profile = "server"hx manages both toolchains for you — no separate ghcup or manual installs.
4. Build, test, run
hx build # compile
hx test # run the test suite
hx run # run the app
hx fmt # format
hx doctor # diagnose toolchain issuesOne tool for the whole workflow — build, test, run, format, lint, and publish.
Where to next
- New to the why? Read the manifesto.
- Coming from Cabal or Stack? See hx vs Cabal and Stack.
- Curious about the compiler? See BHC vs GHC and the BHC site.
- Full reference: hx docs and BHC docs.