| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Network.Email.Header.Doc
Description
Header formatting and pretty-printing.
Synopsis
- 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
data RenderOptions Source #
Rendering options.
Constructors
| RenderOptions | |
Instances
| Eq RenderOptions Source # | |
Defined in Network.Email.Header.Doc Methods (==) :: RenderOptions -> RenderOptions -> Bool # (/=) :: RenderOptions -> RenderOptions -> Bool # | |
| Show RenderOptions Source # | |
Defined in Network.Email.Header.Doc Methods showsPrec :: Int -> RenderOptions -> ShowS # show :: RenderOptions -> String # showList :: [RenderOptions] -> ShowS # | |
The encoding used for binary characters in an encoded word.
Constructors
| QP | Quoted-printable encoding. Spaces are represented with underscores, and undisplayable characters are represented as hex pairs. |
| Base64 | Base 64 encoding of all characters. |
Instances
| Bounded Encoding Source # | |
| Enum Encoding Source # | |
Defined in Network.Email.Header.Doc | |
| Eq Encoding Source # | |
| Ord Encoding Source # | |
Defined in Network.Email.Header.Doc | |
| Read Encoding Source # | |
| Show Encoding Source # | |
defaultRenderOptions :: RenderOptions Source #
Default rendering options, which uses a line width of 80, and indent of 2, and utf-8 quated-printable encoding.
Rendering
A formatted email header.
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.