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

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

newtype Alignment #

Constructors

Alignment Int |

#### Instances

Instances details

Eq Alignment # |
Instance details Defined in Hpack.Render.Dsl Methods (==) :: Alignment -> Alignment -> Bool # (/=) :: Alignment -> Alignment -> Bool #
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 #

data CommaStyle #

Constructors

LeadingCommas |
TrailingCommas |

#### Instances

Instances details

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