hpack-0.31.2: 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 Source #

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

defaultRenderSettings :: RenderSettings Source #

data RenderSettings Source #

Constructors

RenderSettings |

Fields

- renderSettingsIndentation :: Int
- renderSettingsFieldAlignment :: Alignment
- renderSettingsCommaStyle :: CommaStyle

Instances

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

newtype Alignment Source #

Constructors

Alignment Int |

Instances

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

data CommaStyle Source #

Constructors

LeadingCommas |
TrailingCommas |

Instances

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