The package version.
Modulehpack-0.39.6Haskell2010
Hpack
Contents
Synopsis
- value version
- value hpack
- value hpackResult
- value hpackResultWithError
- value printResult
- data Result
- data Status
- value defaultOptions
- value setProgramName
- value setTarget
- value setDecode
- value setFormatYamlParseError
- value getOptions
- data Verbose
- data Options
- data Force
- data GenerateHashStrategy
- data OutputStrategy
- Packagehpack-0.39.6
- Exports18
- LanguageHaskell2010
- LicenceMIT
- SourcePaths_hpack.hs
NOTE: This module is exposed to allow integration of Hpack into other tools. It is not meant for general use by end users. The following caveats apply:
The API is undocumented, consult the source instead.
The exposed types and functions primarily serve Hpack's own needs, not that of a public API. Breaking changes can happen as Hpack evolves.
As an Hpack user you either want to use the hpack executable or a build
tool that supports Hpack (e.g. stack or cabal2nix).
Version
Running Hpack
Constructors
Options
This is used to format any ParseExceptions encountered during decoding of defaults.
Note that:
This is not used to format ParseExceptions encountered during decoding of the main
package.yaml. To customize this you have to set a custom decode function.Some of the constructors of ParseException are never produced by Hpack (e.g. AesonException as Hpack uses it's own mechanism to decode Values).
Example:
example :: IO (Either HpackError Result)
example = hpackResultWithError options
where
options :: Options
options = setCustomYamlParseErrorFormat format defaultOptions
format :: FilePath -> ParseException -> String
format file err = file ++ ": " ++ displayException err
setCustomYamlParseErrorFormat :: (FilePath -> ParseException -> String) -> Options -> Options
setCustomYamlParseErrorFormat format = setDecode decode >>> setFormatYamlParseError format
where
decode :: FilePath -> IO (Either String ([String], Value))
decode file = first (format file) <$> decodeYamlWithParseError file
Instances2Eq, Show
Eq GenerateHashStrategyDefined in hpack-0.39.6 · HpackShow GenerateHashStrategyDefined in hpack-0.39.6 · Hpack
Instances2Eq, Show
Eq OutputStrategyDefined in hpack-0.39.6 · Hpack.OptionsShow OutputStrategyDefined in hpack-0.39.6 · Hpack.Options