Cabal-3.2.1.0: A framework for packaging Haskell software
Safe Haskell None
Language Haskell2010

Distribution.Fields.Pretty

Description

Cabal-like file AST types: Field , Section etc,

This (intermediate) data type is used for pretty-printing.

Since: 3.0.0.0

Synopsis

Fields

data PrettyField ann Source #

Instances

Instances details
Functor PrettyField Source #
Instance details

Defined in Distribution.Fields.Pretty

Foldable PrettyField Source #
Instance details

Defined in Distribution.Fields.Pretty

Traversable PrettyField Source #
Instance details

Defined in Distribution.Fields.Pretty

showFields :: (ann -> [ String ]) -> [ PrettyField ann] -> String Source #

Prettyprint a list of fields.

Note: the first argument should return String s without newlines and properly prefixes (with -- ) to count as comments. This unsafety is left in place so one could generate empty lines between comment lines.

showFields' :: (ann -> [ String ]) -> Int -> [ PrettyField ann] -> String Source #

showFields with user specified indentation.

Transformation from Field

fromParsecFields :: [ Field ann] -> [ PrettyField ann] Source #

Simple variant of genericFromParsecField

genericFromParsecFields Source #

Arguments

:: Applicative f
=> ( FieldName -> [ FieldLine ann] -> f Doc )

transform field contents

-> ( FieldName -> [ SectionArg ann] -> f [ Doc ])

transform section arguments

-> [ Field ann]
-> f [ PrettyField ann]