Generated reference for the harmont Haskell API.
haskell
Callable singleton for the Haskell toolchain — access as hm.haskell.
Supports both object form (hm.haskell(ghc="9.6.7")) and bare form
(hm.haskell.build(ghc="9.6.7", path="api"), etc.).
haskell(*, ghc=None, cabal='latest', image=None, base=None, path=None, cache_paths=None) -> HaskellToolchain | HaskellPackage| Parameter | Type | Default | Description |
|---|---|---|---|
ghc | str | None | None | GHC version to install (e.g. "9.6.7"). Required. |
cabal | str | 'latest' | cabal-install version. Defaults to "latest". |
image | str | None | None | Local-mode Docker base image override. |
base | Step | None | None | Existing Step to attach to instead of emitting a fresh |
| apt-base step. | |||
path | str | None | None | Cabal package root. When provided, the call returns a |
HaskellPackage directly rather than a toolchain. | |||
cache_paths | tuple[str, ...] | None | None | Override the cabal-file paths for deps-step cache |
invalidation. Only meaningful when path is also set. |
Returns HaskellToolchain | HaskellPackage — A HaskellToolchain when path is omitted, or a
haskell.build()
build(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
haskell.fmt()
fmt(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
haskell.hlint()
hlint(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
haskell.lint()
lint(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
haskell.test()
test(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
HaskellEntry
Callable singleton for the Haskell toolchain — access as hm.haskell.
Supports both object form (hm.haskell(ghc="9.6.7")) and bare form
(hm.haskell.build(ghc="9.6.7", path="api"), etc.).
HaskellEntry.build()
build(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
HaskellEntry.fmt()
fmt(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
HaskellEntry.hlint()
hlint(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
HaskellEntry.lint()
lint(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
HaskellEntry.test()
test(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
HaskellPackage
One cabal package — returned by HaskellToolchain.package().
installed is the package's deps step (the chain ancestor every
action leaf attaches to). Exposed so callers can chain custom commands
onto the deps-installed snapshot via pkg.installed.sh(...).
Fields
| Field | Type | Default |
|---|---|---|
path | str | required |
installed | Step | required |
HaskellPackage.build()
build(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
HaskellPackage.fmt()
fmt(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
HaskellPackage.hlint()
hlint(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
HaskellPackage.lint()
lint(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
HaskellPackage.test()
test(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
HaskellToolchain
Haskell toolchain install chain — constructed via hm.haskell().
Holds the shared ghcup install step. Spawn one HaskellPackage
per cabal package via .package(path). All packages from one
toolchain share the same ghcup-install step.
Fields
| Field | Type | Default |
|---|---|---|
ghc | str | required |
cabal_version | str | required |
installed | Step | required |
HaskellToolchain.cabal()
cabal(path, *, cache_paths=None) -> HaskellPackageCreate a HaskellPackage for the cabal package at path.
Alias for .package(); reads more naturally for cabal projects.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | str | required | Path to the cabal package root. |
cache_paths | tuple[str, ...] | None | None | Override the set of paths used for cache invalidation. |
Returns HaskellPackage — A HaskellPackage ready for action methods.
HaskellToolchain.package()
package(path, *, cache_paths=None) -> HaskellPackageCreate a HaskellPackage for the cabal package at path.
Emits a cabal build all --only-dependencies step cached on the
package's cabal files. Action methods on the returned package attach
to that deps step.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | str | required | Path to the cabal package root. Must contain a *.cabal |
file and optionally a cabal.project. | |||
cache_paths | tuple[str, ...] | None | None | Override the set of paths used for cache invalidation. |
Defaults to (f"\{path\}/*.cabal", f"\{path\}/cabal.project"). |
Returns HaskellPackage — A HaskellPackage ready for action methods.
Examples
>>> import harmont as hm
>>> tc = hm.haskell(ghc="9.6.7")
>>> pkg = tc.package("api")
>>> hm.pipeline(pkg.build(), pkg.test())