hx bhc-platform

Manage BHC Platform curated snapshots.

Synopsis

hx bhc-platform <COMMAND>

Description

The bhc-platform command manages BHC Platform curated snapshots — Stackage-like package sets optimized for the BHC (Basel Haskell Compiler) backend. Each snapshot provides a set of packages verified to build and work together under BHC.

Subcommands

list

List all available BHC Platform snapshots.

hx bhc-platform list

Output:

  Available  BHC Platform snapshots

  bhc-platform-2026.1 (BHC 0.1.0, GHC-compat 9.8.2, 70 packages)

Set a platform with: hx bhc-platform set <platform>

info

Show detailed information about a snapshot.

hx bhc-platform info <PLATFORM> [OPTIONS]

Options:

    --packages    Show all packages in the snapshot

Examples:

# Show snapshot metadata
hx bhc-platform info bhc-platform-2026.1

# Show all packages
hx bhc-platform info bhc-platform-2026.1 --packages

Output:

  Platform  bhc-platform-2026.1

  GHC compatibility: 9.8.2
  Packages:          70
  BHC version:       0.1.0
  Recommended profile: default

set

Set the BHC Platform snapshot for the current project.

hx bhc-platform set <PLATFORM>

This updates the [bhc-platform].snapshot field in your hx.toml.

Example:

hx bhc-platform set bhc-platform-2026.1

Output:

  Set  BHC Platform to bhc-platform-2026.1 (70 packages, BHC 0.1.0)

Available Snapshots

bhc-platform-2026.1

The initial BHC Platform snapshot, curated for BHC 0.1.0 with GHC 9.8.2 compatibility. Contains ~70 packages covering:

CategoryKey Packages
Corebase, ghc-prim, template-haskell
Text & Datatext, bytestring, aeson, yaml
Containerscontainers, vector, unordered-containers
Transformersmtl, transformers, unliftio
Webservant, servant-server, warp, wai
Numerichmatrix, statistics, massiv
Testinghspec, QuickCheck, tasty, hedgehog
Parsingmegaparsec, attoparsec, optparse-applicative

Configuration

[compiler]
backend = "bhc"

[bhc-platform]
snapshot = "bhc-platform-2026.1"
allow_newer = false
extra_deps = {}
FieldTypeDefaultDescription
snapshotstringnoneSnapshot identifier
allow_newerboolfalseAllow packages outside the snapshot
extra_depstable{}Override specific package versions

How It Works

  1. BHC Platform snapshots are embedded in hx (no network fetch required)
  2. When you run hx lock with a snapshot configured and backend = "bhc", package versions from the snapshot are pinned in the resolver
  3. The lockfile records which snapshot was used
  4. Additional dependencies from Hackage can be allowed with allow_newer = true

Snapshot Identifiers

FormatExampleDescription
bhc-platform-YYYY.Nbhc-platform-2026.1Specific snapshot version

Exit Codes

CodeMeaning
0Success
1Invalid platform identifier or platform not found

See Also