Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Deprecated: Compatibility module for users of wl-pprint - use Data.Text.Prettyprint.Doc instead
- type Doc = Doc ()
- putDoc :: Doc -> IO ()
- hPutDoc :: Handle -> Doc -> IO ()
- empty :: Doc
- char :: Char -> Doc
- text :: String -> Doc
- (<>) :: Monoid m => m -> m -> m
- nest :: Int -> Doc -> Doc
- line :: Doc
- linebreak :: Doc
- group :: Doc -> Doc
- softline :: Doc
- softbreak :: Doc
- align :: Doc -> Doc
- hang :: Int -> Doc -> Doc
- indent :: Int -> Doc -> Doc
- encloseSep :: Doc -> Doc -> Doc -> [Doc] -> Doc
- list :: [Doc] -> Doc
- tupled :: [Doc] -> Doc
- semiBraces :: [Doc] -> Doc
- (<+>) :: Doc -> Doc -> Doc
- (<$>) :: Doc -> Doc -> Doc
- (</>) :: Doc -> Doc -> Doc
- (<$$>) :: Doc -> Doc -> Doc
- (<//>) :: Doc -> Doc -> Doc
- hsep :: [Doc] -> Doc
- vsep :: [Doc] -> Doc
- fillSep :: [Doc] -> Doc
- sep :: [Doc] -> Doc
- hcat :: [Doc] -> Doc
- vcat :: [Doc] -> Doc
- fillCat :: [Doc] -> Doc
- cat :: [Doc] -> Doc
- punctuate :: Doc -> [Doc] -> [Doc]
- fill :: Int -> Doc -> Doc
- fillBreak :: Int -> Doc -> Doc
- enclose :: Doc -> Doc -> Doc -> Doc
- squotes :: Doc -> Doc
- dquotes :: Doc -> Doc
- parens :: Doc -> Doc
- angles :: Doc -> Doc
- braces :: Doc -> Doc
- brackets :: Doc -> Doc
- lparen :: Doc
- rparen :: Doc
- langle :: Doc
- rangle :: Doc
- lbrace :: Doc
- rbrace :: Doc
- lbracket :: Doc
- rbracket :: Doc
- squote :: Doc
- dquote :: Doc
- semi :: Doc
- colon :: Doc
- comma :: Doc
- space :: Doc
- dot :: Doc
- backslash :: Doc
- equals :: Doc
- string :: String -> Doc
- int :: Int -> Doc
- integer :: Integer -> Doc
- float :: Float -> Doc
- double :: Double -> Doc
- rational :: Rational -> Doc
- class Pretty a where
- type SimpleDoc = SimpleDoc ()
- renderPretty :: Float -> Int -> Doc -> SimpleDoc
- renderCompact :: Doc -> SimpleDoc
- displayS :: SimpleDoc -> ShowS
- displayIO :: Handle -> SimpleDoc -> IO ()
- bool :: Bool -> Doc
- column :: (Int -> Doc) -> Doc
- nesting :: (Int -> Doc) -> Doc
- width :: Doc -> (Int -> Doc) -> Doc
Documentation
semiBraces :: [Doc] -> Doc Source #
Overloaded conversion to Doc
.
>>>
pretty 1 <+> pretty "hello" <+> pretty 1.234
1 hello 1.234
prettyList :: [a] -> Doc ann #
is only used to define the prettyList
instance
. In normal circumstances only the Pretty
a => Pretty
[a]
function is used.pretty
>>>
prettyList [1, 23, 456]
[1, 23, 456]
Pretty Bool |
|
Pretty Char | Instead of
|
Pretty Double |
|
Pretty Float |
|
Pretty Int |
|
Pretty Int8 | |
Pretty Int16 | |
Pretty Int32 | |
Pretty Int64 | |
Pretty Integer |
|
Pretty Word | |
Pretty Word8 | |
Pretty Word16 | |
Pretty Word32 | |
Pretty Word64 | |
Pretty () |
The argument is not used,
|
Pretty Natural | |
Pretty Void | I tried finding a good example to show here but could not find one |
Pretty Text | (lazy |
Pretty Text | Automatically converts all newlines to
Note that
Manually use |
Pretty a => Pretty [a] |
|
Pretty a => Pretty (Maybe a) | Ignore
|
Pretty a => Pretty (NonEmpty a) | |
Pretty (Doc ann) | Does not change the text, but removes all annotations. Pitfall: since
this un-annotates its argument, nesting it means multiple, potentially
costly, traversals over the
|
(Pretty a1, Pretty a2) => Pretty (a1, a2) |
|
(Pretty a1, Pretty a2, Pretty a3) => Pretty (a1, a2, a3) |
|
renderCompact :: Doc -> SimpleDoc Source #