Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Deprecated: Compatibility module for users of ansi-wl-pprint - use Prettyprinter instead
Synopsis
- type Doc = Doc AnsiStyle
- putDoc :: Doc -> IO ()
- hPutDoc :: Handle -> Doc -> IO ()
- empty :: Doc
- char :: Char -> Doc
- text :: String -> Doc
- (<>) :: Semigroup a => a -> a -> a
- nest :: Int -> Doc -> Doc
- line :: Doc
- linebreak :: Doc
- group :: Doc -> Doc
- softline :: Doc
- softbreak :: Doc
- hardline :: Doc
- flatAlt :: Doc -> Doc -> Doc
- renderSmart :: Float -> Int -> Doc -> SimpleDoc
- 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
- black :: Doc -> Doc
- red :: Doc -> Doc
- green :: Doc -> Doc
- yellow :: Doc -> Doc
- blue :: Doc -> Doc
- magenta :: Doc -> Doc
- cyan :: Doc -> Doc
- white :: Doc -> Doc
- dullblack :: Doc -> Doc
- dullred :: Doc -> Doc
- dullgreen :: Doc -> Doc
- dullyellow :: Doc -> Doc
- dullblue :: Doc -> Doc
- dullmagenta :: Doc -> Doc
- dullcyan :: Doc -> Doc
- dullwhite :: Doc -> Doc
- onblack :: Doc -> Doc
- onred :: Doc -> Doc
- ongreen :: Doc -> Doc
- onyellow :: Doc -> Doc
- onblue :: Doc -> Doc
- onmagenta :: Doc -> Doc
- oncyan :: Doc -> Doc
- onwhite :: Doc -> Doc
- ondullblack :: Doc -> Doc
- ondullred :: Doc -> Doc
- ondullgreen :: Doc -> Doc
- ondullyellow :: Doc -> Doc
- ondullblue :: Doc -> Doc
- ondullmagenta :: Doc -> Doc
- ondullcyan :: Doc -> Doc
- ondullwhite :: Doc -> Doc
- bold :: Doc -> Doc
- debold :: Doc -> Doc
- underline :: Doc -> Doc
- deunderline :: Doc -> Doc
- plain :: Doc -> Doc
- string :: String -> Doc
- int :: Int -> Doc
- integer :: Integer -> Doc
- float :: Float -> Doc
- double :: Double -> Doc
- rational :: Rational -> Doc
- class Pretty a where
- pretty :: a -> Doc ann
- prettyList :: [a] -> Doc ann
- type SimpleDoc = SimpleDocStream AnsiStyle
- renderPretty :: Float -> Int -> Doc -> SimpleDoc
- renderCompact :: Doc -> SimpleDoc
- displayS :: SimpleDoc -> ShowS
- displayIO :: Handle -> SimpleDoc -> IO ()
- bool :: Bool -> Doc
- column :: (Int -> Doc) -> Doc
- columns :: (Maybe Int -> Doc) -> Doc
- nesting :: (Int -> Doc) -> Doc
- width :: Doc -> (Int -> Doc) -> Doc
Documentation
(<>) :: Semigroup a => a -> a -> a infixr 6 #
An associative operation.
>>>
[1,2,3] <> [4,5,6]
[1,2,3,4,5,6]
semiBraces :: [Doc] -> Doc Source #
dullyellow :: Doc -> Doc Source #
dullmagenta :: Doc -> Doc Source #
ondullblack :: Doc -> Doc Source #
ondullgreen :: Doc -> Doc Source #
ondullyellow :: Doc -> Doc Source #
ondullblue :: Doc -> Doc Source #
ondullmagenta :: Doc -> Doc Source #
ondullcyan :: Doc -> Doc Source #
ondullwhite :: Doc -> Doc Source #
deunderline :: Doc -> Doc Source #
>>>
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]
Instances
Pretty Bool |
|
Defined in Prettyprinter.Internal | |
Pretty Char | Instead of
|
Defined in Prettyprinter.Internal | |
Pretty Double |
|
Defined in Prettyprinter.Internal | |
Pretty Float |
|
Defined in Prettyprinter.Internal | |
Pretty Int |
|
Defined in Prettyprinter.Internal | |
Pretty Int8 | |
Defined in Prettyprinter.Internal | |
Pretty Int16 | |
Defined in Prettyprinter.Internal | |
Pretty Int32 | |
Defined in Prettyprinter.Internal | |
Pretty Int64 | |
Defined in Prettyprinter.Internal | |
Pretty Integer |
|
Defined in Prettyprinter.Internal | |
Pretty Natural | |
Defined in Prettyprinter.Internal | |
Pretty Word | |
Defined in Prettyprinter.Internal | |
Pretty Word8 | |
Defined in Prettyprinter.Internal | |
Pretty Word16 | |
Defined in Prettyprinter.Internal | |
Pretty Word32 | |
Defined in Prettyprinter.Internal | |
Pretty Word64 | |
Defined in Prettyprinter.Internal | |
Pretty () |
The argument is not used:
|
Defined in Prettyprinter.Internal | |
Pretty Void | Finding a good example for printing something that does not exist is hard, so here is an example of printing a list full of nothing.
|
Defined in Prettyprinter.Internal | |
Pretty Text | (lazy |
Defined in Prettyprinter.Internal | |
Pretty Text | Automatically converts all newlines to
Note that
Manually use |
Defined in Prettyprinter.Internal | |
Pretty a => Pretty [a] |
|
Defined in Prettyprinter.Internal | |
Pretty a => Pretty (Maybe a) | Ignore
|
Defined in Prettyprinter.Internal | |
Pretty a => Pretty (Identity a) |
|
Defined in Prettyprinter.Internal | |
Pretty a => Pretty (NonEmpty a) | |
Defined in Prettyprinter.Internal | |
(Pretty a1, Pretty a2) => Pretty (a1, a2) |
|
Defined in Prettyprinter.Internal | |
(Pretty a1, Pretty a2, Pretty a3) => Pretty (a1, a2, a3) |
|
Defined in Prettyprinter.Internal | |
Pretty a => Pretty (Const a b) | |
Defined in Prettyprinter.Internal |
type SimpleDoc = SimpleDocStream AnsiStyle Source #
renderCompact :: Doc -> SimpleDoc Source #