hpack-0.34.2: A modern format for Haskell packages

Safe Haskell | None
Language | Haskell2010

Hpack

Contents

- Version
- Running Hpack
- Options

Synopsis

- version :: Version
- hpack :: Verbose -> Options -> IO ()
- hpackResult :: Options -> IO Result
- printResult :: Verbose -> Result -> IO ()
- data Result = Result {
  - resultWarnings :: [String]
  - resultCabalFile :: String
  - resultStatus :: Status
  }
- data Status
  - = Generated
  - | ExistingCabalFileWasModifiedManually
  - | AlreadyGeneratedByNewerHpack
  - | OutputUnchanged
- defaultOptions :: Options
- setProgramName :: ProgramName -> Options -> Options
- setTarget :: FilePath -> Options -> Options
- setDecode :: (FilePath -> IO (Either String ([String], Value))) -> Options -> Options
- getOptions :: FilePath -> [String] -> IO (Maybe (Verbose, Options))
- data Verbose
  - = Verbose
  - | NoVerbose
- data Options = Options {
  - optionsDecodeOptions :: DecodeOptions
  - optionsForce :: Force
  - optionsGenerateHashStrategy :: GenerateHashStrategy
  - optionsToStdout :: Bool
  }
- data Force
  - = Force
  - | NoForce
- data GenerateHashStrategy
  - = ForceHash
  - | ForceNoHash
  - | PreferHash
  - | PreferNoHash

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

# Version

version :: Version Source #

# Running Hpack

hpack :: Verbose -> Options -> IO () Source #

hpackResult :: Options -> IO Result Source #

printResult :: Verbose -> Result -> IO () Source #

data Result Source #

Constructors

Result |

Fields

- resultWarnings :: [String]
- resultCabalFile :: String
- resultStatus :: Status

#### Instances

Instances details

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

data Status Source #

Constructors

Generated |
ExistingCabalFileWasModifiedManually |
AlreadyGeneratedByNewerHpack |
OutputUnchanged |

#### Instances

Instances details

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

# Options

defaultOptions :: Options Source #

setProgramName :: ProgramName -> Options -> Options Source #

setTarget :: FilePath -> Options -> Options Source #

setDecode :: (FilePath -> IO (Either String ([String], Value))) -> Options -> Options Source #

getOptions :: FilePath -> [String] -> IO (Maybe (Verbose, Options)) Source #

data Verbose Source #

Constructors

Verbose |
NoVerbose |

#### Instances

Instances details

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

data Options Source #

Constructors

Options |

Fields

- optionsDecodeOptions :: DecodeOptions
- optionsForce :: Force
- optionsGenerateHashStrategy :: GenerateHashStrategy
- optionsToStdout :: Bool

data Force Source #

Constructors

Force |
NoForce |

#### Instances

Instances details

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

data GenerateHashStrategy Source #

Constructors

ForceHash |
ForceNoHash |
PreferHash |
PreferNoHash |

#### Instances

Instances details

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