Harmont docs
Pipeline SDKReferenceToolchains

Haskell

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
ParameterTypeDefaultDescription
ghcstr | NoneNoneGHC version to install (e.g. "9.6.7"). Required.
cabalstr'latest'cabal-install version. Defaults to "latest".
imagestr | NoneNoneLocal-mode Docker base image override.
baseStep | NoneNoneExisting Step to attach to instead of emitting a fresh
apt-base step.
pathstr | NoneNoneCabal package root. When provided, the call returns a
HaskellPackage directly rather than a toolchain.
cache_pathstuple[str, ...] | NoneNoneOverride 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
ParameterTypeDefaultDescription
kwAny{}

Returns Step

haskell.fmt()

fmt(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

haskell.hlint()

hlint(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

haskell.lint()

lint(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

haskell.test()

test(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

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
ParameterTypeDefaultDescription
kwAny{}

Returns Step

HaskellEntry.fmt()

fmt(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

HaskellEntry.hlint()

hlint(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

HaskellEntry.lint()

lint(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

HaskellEntry.test()

test(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

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

FieldTypeDefault
pathstrrequired
installedSteprequired

HaskellPackage.build()

build(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

HaskellPackage.fmt()

fmt(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

HaskellPackage.hlint()

hlint(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

HaskellPackage.lint()

lint(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

HaskellPackage.test()

test(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

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

FieldTypeDefault
ghcstrrequired
cabal_versionstrrequired
installedSteprequired

HaskellToolchain.cabal()

cabal(path, *, cache_paths=None) -> HaskellPackage

Create a HaskellPackage for the cabal package at path.

Alias for .package(); reads more naturally for cabal projects.

ParameterTypeDefaultDescription
pathstrrequiredPath to the cabal package root.
cache_pathstuple[str, ...] | NoneNoneOverride the set of paths used for cache invalidation.

Returns HaskellPackage — A HaskellPackage ready for action methods.

HaskellToolchain.package()

package(path, *, cache_paths=None) -> HaskellPackage

Create 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.

ParameterTypeDefaultDescription
pathstrrequiredPath to the cabal package root. Must contain a *.cabal
file and optionally a cabal.project.
cache_pathstuple[str, ...] | NoneNoneOverride 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())

On this page