template-haskell-2.2.0.0Source codeContentsIndex
Language.Haskell.TH.PprLib
Contents
The document type
Primitive Documents
Converting values into documents
Wrapping documents in delimiters
Combining documents
Predicates on documents
Synopsis
type Doc = PprM Doc
data PprM a
empty :: Doc
semi :: Doc
comma :: Doc
colon :: Doc
space :: Doc
equals :: Doc
lparen :: Doc
rparen :: Doc
lbrack :: Doc
rbrack :: Doc
lbrace :: Doc
rbrace :: Doc
text :: String -> Doc
char :: Char -> Doc
ptext :: String -> Doc
int :: Int -> Doc
integer :: Integer -> Doc
float :: Float -> Doc
double :: Double -> Doc
rational :: Rational -> Doc
parens :: Doc -> Doc
brackets :: Doc -> Doc
braces :: Doc -> Doc
quotes :: Doc -> Doc
doubleQuotes :: Doc -> Doc
(<>) :: Doc -> Doc -> Doc
(<+>) :: Doc -> Doc -> Doc
hcat :: [Doc] -> Doc
hsep :: [Doc] -> Doc
($$) :: Doc -> Doc -> Doc
($+$) :: Doc -> Doc -> Doc
vcat :: [Doc] -> Doc
sep :: [Doc] -> Doc
cat :: [Doc] -> Doc
fsep :: [Doc] -> Doc
fcat :: [Doc] -> Doc
nest :: Int -> Doc -> Doc
hang :: Doc -> Int -> Doc -> Doc
punctuate :: Doc -> [Doc] -> [Doc]
isEmpty :: Doc -> PprM Bool
to_HPJ_Doc :: Doc -> Doc
pprName :: Name -> Doc
pprName' :: NameIs -> Name -> Doc
The document type
type Doc = PprM DocSource
data PprM aSource
show/hide Instances
Primitive Documents
empty :: DocSource
An empty document
semi :: DocSource
A ';' character
comma :: DocSource
A ',' character
colon :: DocSource
A ':' character
space :: DocSource
A space character
equals :: DocSource
A '=' character
lparen :: DocSource
A '(' character
rparen :: DocSource
A ')' character
lbrack :: DocSource
A '[' character
rbrack :: DocSource
A ']' character
lbrace :: DocSource
A '{' character
rbrace :: DocSource
A '}' character
Converting values into documents
text :: String -> DocSource
char :: Char -> DocSource
ptext :: String -> DocSource
int :: Int -> DocSource
integer :: Integer -> DocSource
float :: Float -> DocSource
double :: Double -> DocSource
rational :: Rational -> DocSource
Wrapping documents in delimiters
parens :: Doc -> DocSource
Wrap document in (...)
brackets :: Doc -> DocSource
Wrap document in [...]
braces :: Doc -> DocSource
Wrap document in {...}
quotes :: Doc -> DocSource
Wrap document in '...'
doubleQuotes :: Doc -> DocSource
Wrap document in "..."
Combining documents
(<>) :: Doc -> Doc -> DocSource
Beside
(<+>) :: Doc -> Doc -> DocSource
Beside, separated by space
hcat :: [Doc] -> DocSource
List version of <>
hsep :: [Doc] -> DocSource
List version of <+>
($$) :: Doc -> Doc -> DocSource
Above; if there is no overlap it "dovetails" the two
($+$) :: Doc -> Doc -> DocSource
Above, without dovetailing.
vcat :: [Doc] -> DocSource
List version of $$
sep :: [Doc] -> DocSource
Either hsep or vcat
cat :: [Doc] -> DocSource
Either hcat or vcat
fsep :: [Doc] -> DocSource
"Paragraph fill" version of sep
fcat :: [Doc] -> DocSource
"Paragraph fill" version of cat
nest :: Int -> Doc -> DocSource
Nested
hang :: Doc -> Int -> Doc -> DocSource
hang d1 n d2 = sep [d1, nest n d2]
punctuate :: Doc -> [Doc] -> [Doc]Source
punctuate p [d1, ... dn] = [d1 <> p, d2 <> p, ... dn-1 <> p, dn]
Predicates on documents
isEmpty :: Doc -> PprM BoolSource
Returns True if the document is empty
to_HPJ_Doc :: Doc -> DocSource
pprName :: Name -> DocSource
pprName' :: NameIs -> Name -> DocSource
Produced by Haddock version 0.9