Copyright | (c) Brent Yorgey 2009 |
---|---|
License | BSD-like |
Maintainer | [email protected] |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Distribution.Client.Init.Format
Description
Pretty printing and field formatting utilities used for file creation.
Synopsis
- listFieldS :: [String] -> Doc
- field :: Pretty b => FieldName -> (a -> b) -> a -> [String] -> Bool -> WriteOpts -> PrettyField FieldAnnotation
- fieldD :: FieldName -> Doc -> [String] -> Bool -> WriteOpts -> PrettyField FieldAnnotation
- commentedOutWithComments :: CommentPosition -> FieldAnnotation
- withComments :: CommentPosition -> FieldAnnotation
- annNoComments :: FieldAnnotation
- postProcessFieldLines :: FieldAnnotation -> [String] -> [String]
- mkCommonStanza :: WriteOpts -> PrettyField FieldAnnotation
- mkLibStanza :: WriteOpts -> LibTarget -> PrettyField FieldAnnotation
- mkExeStanza :: WriteOpts -> ExeTarget -> PrettyField FieldAnnotation
- mkTestStanza :: WriteOpts -> TestTarget -> PrettyField FieldAnnotation
- mkPkgDescription :: WriteOpts -> PkgDescription -> [PrettyField FieldAnnotation]
cabal file formatters
listFieldS :: [String] -> Doc Source #
field :: Pretty b => FieldName -> (a -> b) -> a -> [String] -> Bool -> WriteOpts -> PrettyField FieldAnnotation Source #
Construct a PrettyField
from a field that can be automatically
converted to a Doc
via display
.
Arguments
:: FieldName | Name of the field |
-> Doc | Field contents |
-> [String] | Comment to explain the field |
-> Bool | Should the field be included (commented out) even if blank? |
-> WriteOpts | |
-> PrettyField FieldAnnotation |
Construct a PrettyField
from a Doc
Flag.
commentedOutWithComments :: CommentPosition -> FieldAnnotation Source #
A field annotation instructing the pretty printer to comment out the field and any contents, with no comments.
withComments :: CommentPosition -> FieldAnnotation Source #
A field annotation with the specified comment lines.
annNoComments :: FieldAnnotation Source #
A field annotation with no comments.
postProcessFieldLines :: FieldAnnotation -> [String] -> [String] Source #