Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Options.Applicative.Help.Pretty
Synopsis
- (<$$>) :: Doc -> Doc -> Doc
- (<+>) :: Doc -> Doc -> Doc
- (<//>) :: Doc -> Doc -> Doc
- (</>) :: Doc -> Doc -> Doc
- align :: Doc -> Doc
- angles :: Doc -> Doc
- backslash :: Doc
- black :: Doc -> Doc
- blue :: Doc -> Doc
- bold :: Doc -> Doc
- bool :: Bool -> Doc
- braces :: Doc -> Doc
- brackets :: Doc -> Doc
- cat :: [Doc] -> Doc
- char :: Char -> Doc
- colon :: Doc
- column :: (Int -> Doc) -> Doc
- comma :: Doc
- cyan :: Doc -> Doc
- debold :: Doc -> Doc
- deunderline :: Doc -> Doc
- displayIO :: Handle -> SimpleDoc -> IO ()
- displayS :: SimpleDoc -> ShowS
- dot :: Doc
- double :: Double -> Doc
- dquote :: Doc
- dquotes :: Doc -> Doc
- dullblack :: Doc -> Doc
- dullblue :: Doc -> Doc
- dullcyan :: Doc -> Doc
- dullgreen :: Doc -> Doc
- dullmagenta :: Doc -> Doc
- dullred :: Doc -> Doc
- dullwhite :: Doc -> Doc
- dullyellow :: Doc -> Doc
- empty :: Doc
- enclose :: Doc -> Doc -> Doc -> Doc
- encloseSep :: Doc -> Doc -> Doc -> [Doc] -> Doc
- equals :: Doc
- fill :: Int -> Doc -> Doc
- fillBreak :: Int -> Doc -> Doc
- fillCat :: [Doc] -> Doc
- fillSep :: [Doc] -> Doc
- flatAlt :: Doc -> Doc -> Doc
- float :: Float -> Doc
- green :: Doc -> Doc
- group :: Doc -> Doc
- hPutDoc :: Handle -> Doc -> IO ()
- hang :: Int -> Doc -> Doc
- hardline :: Doc
- hcat :: [Doc] -> Doc
- hsep :: [Doc] -> Doc
- indent :: Int -> Doc -> Doc
- int :: Int -> Doc
- integer :: Integer -> Doc
- langle :: Doc
- lbrace :: Doc
- lbracket :: Doc
- line :: Doc
- linebreak :: Doc
- list :: [Doc] -> Doc
- lparen :: Doc
- magenta :: Doc -> Doc
- nest :: Int -> Doc -> Doc
- nesting :: (Int -> Doc) -> Doc
- onblack :: Doc -> Doc
- onblue :: Doc -> Doc
- oncyan :: Doc -> Doc
- ondullblack :: Doc -> Doc
- ondullblue :: Doc -> Doc
- ondullcyan :: Doc -> Doc
- ondullgreen :: Doc -> Doc
- ondullmagenta :: Doc -> Doc
- ondullred :: Doc -> Doc
- ondullwhite :: Doc -> Doc
- ondullyellow :: Doc -> Doc
- ongreen :: Doc -> Doc
- onmagenta :: Doc -> Doc
- onred :: Doc -> Doc
- onwhite :: Doc -> Doc
- onyellow :: Doc -> Doc
- parens :: Doc -> Doc
- plain :: Doc -> Doc
- punctuate :: Doc -> [Doc] -> [Doc]
- putDoc :: Doc -> IO ()
- rangle :: Doc
- rational :: Rational -> Doc
- rbrace :: Doc
- rbracket :: Doc
- red :: Doc -> Doc
- renderCompact :: Doc -> SimpleDoc
- renderPretty :: Float -> Int -> Doc -> SimpleDoc
- renderSmart :: Float -> Int -> Doc -> SimpleDoc
- rparen :: Doc
- semi :: Doc
- semiBraces :: [Doc] -> Doc
- sep :: [Doc] -> Doc
- softbreak :: Doc
- softline :: Doc
- space :: Doc
- squote :: Doc
- squotes :: Doc -> Doc
- string :: String -> Doc
- text :: String -> Doc
- tupled :: [Doc] -> Doc
- underline :: Doc -> Doc
- vcat :: [Doc] -> Doc
- vsep :: [Doc] -> Doc
- white :: Doc -> Doc
- width :: Doc -> (Int -> Doc) -> Doc
- yellow :: Doc -> Doc
- data Doc
- class Pretty a where
- pretty :: a -> Doc
- prettyList :: [a] -> Doc
- data SimpleDoc
- (.$.) :: Doc -> Doc -> Doc
- groupOrNestLine :: Doc -> Doc
- altSep :: Doc -> Doc -> Doc
- hangAtIfOver :: Int -> Int -> Doc -> Doc
Documentation
deunderline :: Doc -> Doc #
dullmagenta :: Doc -> Doc #
dullyellow :: Doc -> Doc #
ondullblack :: Doc -> Doc #
ondullblue :: Doc -> Doc #
ondullcyan :: Doc -> Doc #
ondullgreen :: Doc -> Doc #
ondullmagenta :: Doc -> Doc #
ondullwhite :: Doc -> Doc #
ondullyellow :: Doc -> Doc #
renderCompact :: Doc -> SimpleDoc #
renderPretty :: Float -> Int -> Doc -> SimpleDoc #
renderSmart :: Float -> Int -> Doc -> SimpleDoc #
semiBraces :: [Doc] -> Doc #
Instances
Pretty Doc | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal | |
IsString Doc | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal Methods fromString :: String -> Doc | |
Monoid Doc | |
Semigroup Doc | |
Show Doc | |
Minimal complete definition
Instances
Pretty Doc | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal | |
Pretty Integer | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal | |
Pretty () | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal | |
Pretty Bool | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal | |
Pretty Char | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal | |
Pretty Double | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal | |
Pretty Float | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal | |
Pretty Int | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal | |
Pretty a => Pretty (Maybe a) | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal | |
Pretty a => Pretty [a] | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal | |
(Pretty a, Pretty b) => Pretty (a, b) | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal | |
(Pretty a, Pretty b, Pretty c) => Pretty (a, b, c) | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal |
groupOrNestLine :: Doc -> Doc Source #
Render flattened text on this line, or start a new line before rendering any text.
This will also nest subsequent lines in the group.
altSep :: Doc -> Doc -> Doc Source #
Separate items in an alternative with a pipe.
If the first document and the pipe don't fit on the line, then mandatorily flow the next entry onto the following line.
The (//) softbreak ensures that if the document does fit on the line, there is at least a space, but it's possible for y to still appear on the next line.
hangAtIfOver :: Int -> Int -> Doc -> Doc Source #
Printer hacks to get nice indentation for long commands and subcommands.
If we're starting this section over the desired width (usually 1/3 of the ribbon), then we will make a line break, indent all of the usage, and go.
The ifAtRoot is an interesting clause. If this whole
operation is put under a group
then the linebreak
will disappear; then item d will therefore not be at
the starting column, and it won't be indented more.