hpack-0.38.0: A modern format for Haskell packages

Safe Haskell | None
Language | Haskell2010

Hpack.Render

Synopsis

- renderPackage :: [String] -> Package -> String
- renderPackageWith :: RenderSettings -> Alignment -> [String] -> [(String, [String])] -> Package -> String
- defaultRenderSettings :: RenderSettings
- data RenderSettings = RenderSettings {
  - renderSettingsIndentation :: Int
  - renderSettingsFieldAlignment :: Alignment
  - renderSettingsCommaStyle :: CommaStyle
  }
- newtype Alignment = Alignment Int
- data CommaStyle
  - = LeadingCommas
  - | TrailingCommas

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

renderPackage :: [String] -> Package -> String #

renderPackageWith :: RenderSettings -> Alignment -> [String] -> [(String, [String])] -> Package -> String #

defaultRenderSettings :: RenderSettings #

data RenderSettings #

Constructors

RenderSettings |
Fields renderSettingsIndentation :: Int renderSettingsFieldAlignment :: Alignment renderSettingsCommaStyle :: CommaStyle

#### Instances

Instances details

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

newtype Alignment #

Constructors

Alignment Int |

#### Instances

Instances details

Num Alignment # |
Instance details Defined in Hpack.Render.Dsl Methods (+) :: Alignment -> Alignment -> Alignment # (-) :: Alignment -> Alignment -> Alignment # (*) :: Alignment -> Alignment -> Alignment # negate :: Alignment -> Alignment # abs :: Alignment -> Alignment # signum :: Alignment -> Alignment # fromInteger :: Integer -> Alignment #
Show Alignment # |
Instance details Defined in Hpack.Render.Dsl Methods showsPrec :: Int -> Alignment -> ShowS # show :: Alignment -> String # showList :: [Alignment] -> ShowS #
Eq Alignment # |
Instance details Defined in Hpack.Render.Dsl Methods (==) :: Alignment -> Alignment -> Bool # (/=) :: Alignment -> Alignment -> Bool #

data CommaStyle #

Constructors

LeadingCommas |
TrailingCommas |

#### Instances

Instances details

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