hpack-0.35.2: A modern format for Haskell packages

Safe Haskell | Safe-Inferred
Language | Haskell2010

Hpack.Error

Synopsis

- data HpackError
  - = HpackVersionNotSupported FilePath Version Version
  - | DefaultsFileNotFound FilePath
  - | DefaultsDownloadFailed URL Status
  - | CycleInDefaults [FilePath]
  - | ParseError String
  - | DecodeValueError FilePath String
- formatHpackError :: ProgramName -> HpackError -> String
- newtype ProgramName = ProgramName {
  - unProgramName :: String
  }
- type URL = String
- data Status = Status {
  - statusCode :: Int
  - statusMessage :: ByteString
  }
- formatStatus :: Status -> String

# Documentation

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`).

data HpackError Source #

Constructors

HpackVersionNotSupported FilePath Version Version |
DefaultsFileNotFound FilePath |
DefaultsDownloadFailed URL Status |
CycleInDefaults [FilePath] |
ParseError String |
DecodeValueError FilePath String |

#### Instances

Instances details

Show HpackError Source # |
Instance details Defined in Hpack.Error Methods showsPrec :: Int -> HpackError -> ShowS Source # show :: HpackError -> String Source # showList :: [HpackError] -> ShowS Source #
Eq HpackError Source # |
Instance details Defined in Hpack.Error Methods (==) :: HpackError -> HpackError -> Bool Source # (/=) :: HpackError -> HpackError -> Bool Source #

formatHpackError :: ProgramName -> HpackError -> String Source #

newtype ProgramName Source #

Constructors

ProgramName |

Fields

- unProgramName :: String

#### Instances

Instances details

IsString ProgramName Source # |
Instance details Defined in Hpack.Error Methods fromString :: String -> ProgramName Source #
Show ProgramName Source # |
Instance details Defined in Hpack.Error Methods showsPrec :: Int -> ProgramName -> ShowS Source # show :: ProgramName -> String Source # showList :: [ProgramName] -> ShowS Source #
Eq ProgramName Source # |
Instance details Defined in Hpack.Error Methods (==) :: ProgramName -> ProgramName -> Bool Source # (/=) :: ProgramName -> ProgramName -> Bool Source #

type URL = String Source #

data Status Source #

HTTP Status.

Only the `statusCode` is used for comparisons.

Please use `mkStatus` to create status codes from code and message, or the `Enum` instance or the status code constants (like `ok200`). There might be additional record members in the future.

Note that the Show instance is only for debugging.

Constructors

Status |

Fields

- statusCode :: Int
- statusMessage :: ByteString

#### Instances

Instances details

Bounded Status |
Instance details Defined in Network.HTTP.Types.Status Methods minBound :: Status Source # maxBound :: Status Source #
Enum Status |

Instance details

Defined in Network.HTTP.Types.Status

Methods

succ :: Status -> Status Source #

pred :: Status -> Status Source #

toEnum :: Int -> Status Source #

fromEnum :: Status -> Int Source #

enumFrom :: Status -> [Status] Source #

enumFromThen :: Status -> Status -> [Status] Source #

enumFromTo :: Status -> Status -> [Status] Source #

enumFromThenTo :: Status -> Status -> Status -> [Status] Source #

Show Status |
Instance details Defined in Network.HTTP.Types.Status Methods showsPrec :: Int -> Status -> ShowS Source # show :: Status -> String Source # showList :: [Status] -> ShowS Source #
Eq Status |
Instance details Defined in Network.HTTP.Types.Status Methods (==) :: Status -> Status -> Bool Source # (/=) :: Status -> Status -> Bool Source #
Ord Status |
Instance details Defined in Network.HTTP.Types.Status Methods compare :: Status -> Status -> Ordering Source # (<) :: Status -> Status -> Bool Source # (<=) :: Status -> Status -> Bool Source # (>) :: Status -> Status -> Bool Source # (>=) :: Status -> Status -> Bool Source # max :: Status -> Status -> Status Source # min :: Status -> Status -> Status Source #

formatStatus :: Status -> String Source #