hpack-0.38.3: 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

Data Status | Since: http-types-0.12.4

Instance details

Defined in Network.HTTP.Types.Status

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Status -> c Status Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Status Source #

toConstr :: Status -> Constr Source #

dataTypeOf :: Status -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Status) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Status) Source #

gmapT :: (forall b. Data b => b -> b) -> Status -> Status Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Status -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Status -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Status -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Status -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Status -> m Status Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Status -> m Status Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Status -> m Status Source #

Bounded Status | Since: http-types-0.11
Instance details Defined in Network.HTTP.Types.Status Methods minBound :: Status Source # maxBound :: Status Source #
Enum Status | Be advised, that when using the "enumFrom*" family of methods or ranges in lists, it will generate all possible status codes. E.g. `[status100 .. status200]` generates `Status`es of `100, 101, 102 .. 198, 199, 200` The statuses not included in this library will have an empty message. Since: http-types-0.7.3

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 #

Generic Status |

Instance details

Defined in Network.HTTP.Types.Status

Associated Types

type Rep Status | Since: http-types-0.12.4

Instance details

Defined in Network.HTTP.Types.Status

type Rep Status = D1 ('MetaData "Status" "Network.HTTP.Types.Status" "http-types-0.12.4-1OvlBK9BqlVDFTI6Nz1ui2" 'False) (C1 ('MetaCons "Status" 'PrefixI 'True) (S1 ('MetaSel ('Just "statusCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "statusMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

Methods

from :: Status -> Rep Status x Source #

to :: Rep Status x -> 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 | A `Status` is equal to another `Status` if the status codes are equal.
Instance details Defined in Network.HTTP.Types.Status Methods (==) :: Status -> Status -> Bool Source # (/=) :: Status -> Status -> Bool Source #
Ord Status | `Status`es are ordered according to their status codes only.
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 #
type Rep Status | Since: http-types-0.12.4

Instance details

Defined in Network.HTTP.Types.Status

type Rep Status = D1 ('MetaData "Status" "Network.HTTP.Types.Status" "http-types-0.12.4-1OvlBK9BqlVDFTI6Nz1ui2" 'False) (C1 ('MetaCons "Status" 'PrefixI 'True) (S1 ('MetaSel ('Just "statusCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "statusMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

formatStatus :: Status -> String Source #