Safe Haskell | None |
---|---|
Language | Haskell98 |
Header formatting and pretty-printing.
- data RenderOptions = RenderOptions {}
- data Encoding
- defaultRenderOptions :: RenderOptions
- data Doc
- render :: RenderOptions -> Int -> Doc -> Builder
- prim :: (RenderOptions -> Bool -> Layout Builder) -> Doc
- group :: Doc -> Doc
- builder :: Int -> Builder -> Doc
- string :: String -> Doc
- byteString :: ByteString -> Doc
- text :: Text -> Doc
- space :: Layout Builder
- newline :: RenderOptions -> Layout Builder
- line :: Doc
- linebreak :: Doc
- softline :: Doc
- softbreak :: Doc
- (</>) :: Doc -> Doc -> Doc
- sep :: [Doc] -> Doc
- punctuate :: Monoid a => a -> [a] -> [a]
Rendering options
The encoding used for binary characters in an encoded word.
defaultRenderOptions :: RenderOptions Source #
Default rendering options, which uses a line width of 80, and indent of 2, and utf-8 quated-printable encoding.
Rendering
render :: RenderOptions -> Int -> Doc -> Builder Source #
Render a document with the given options and initial position.
Construction
prim :: (RenderOptions -> Bool -> Layout Builder) -> Doc Source #
Construct a primitive document from a layout function. The function takes
two parameters: the rendering options, and a Bool
which indicates
whether the containing group is laid out horizontally instead of vertically.
byteString :: ByteString -> Doc Source #
Construct a Doc
from a ByteString
.
Spacing
newline :: RenderOptions -> Layout Builder Source #
A newline layout. This will emit a CRLF
pair, break to a new line,
and indent.