optparse-applicative-0.17.1.0: Utilities and combinators for parsing command line options
Safe HaskellSafe-Inferred
LanguageHaskell98

Options.Applicative.Help.Pretty

Synopsis

Documentation

class Pretty a where #

Minimal complete definition

pretty

Methods

pretty :: a -> Doc #

prettyList :: [a] -> Doc #

Instances

Instances details
Pretty Doc 
Instance details

Defined in Text.PrettyPrint.ANSI.Leijen.Internal

Methods

pretty :: Doc -> Doc #

prettyList :: [Doc] -> Doc #

Pretty Integer 
Instance details

Defined in Text.PrettyPrint.ANSI.Leijen.Internal

Methods

pretty :: Integer -> Doc #

prettyList :: [Integer] -> Doc #

Pretty () 
Instance details

Defined in Text.PrettyPrint.ANSI.Leijen.Internal

Methods

pretty :: () -> Doc #

prettyList :: [()] -> Doc #

Pretty Bool 
Instance details

Defined in Text.PrettyPrint.ANSI.Leijen.Internal

Methods

pretty :: Bool -> Doc #

prettyList :: [Bool] -> Doc #

Pretty Char 
Instance details

Defined in Text.PrettyPrint.ANSI.Leijen.Internal

Methods

pretty :: Char -> Doc #

prettyList :: [Char] -> Doc #

Pretty Double 
Instance details

Defined in Text.PrettyPrint.ANSI.Leijen.Internal

Methods

pretty :: Double -> Doc #

prettyList :: [Double] -> Doc #

Pretty Float 
Instance details

Defined in Text.PrettyPrint.ANSI.Leijen.Internal

Methods

pretty :: Float -> Doc #

prettyList :: [Float] -> Doc #

Pretty Int 
Instance details

Defined in Text.PrettyPrint.ANSI.Leijen.Internal

Methods

pretty :: Int -> Doc #

prettyList :: [Int] -> Doc #

Pretty a => Pretty (Maybe a) 
Instance details

Defined in Text.PrettyPrint.ANSI.Leijen.Internal

Methods

pretty :: Maybe a -> Doc #

prettyList :: [Maybe a] -> Doc #

Pretty a => Pretty [a] 
Instance details

Defined in Text.PrettyPrint.ANSI.Leijen.Internal

Methods

pretty :: [a] -> Doc #

prettyList :: [[a]] -> Doc #

(Pretty a, Pretty b) => Pretty (a, b) 
Instance details

Defined in Text.PrettyPrint.ANSI.Leijen.Internal

Methods

pretty :: (a, b) -> Doc #

prettyList :: [(a, b)] -> Doc #

(Pretty a, Pretty b, Pretty c) => Pretty (a, b, c) 
Instance details

Defined in Text.PrettyPrint.ANSI.Leijen.Internal

Methods

pretty :: (a, b, c) -> Doc #

prettyList :: [(a, b, c)] -> Doc #

data SimpleDoc #

Constructors

SFail 
SEmpty 
SChar Char SimpleDoc 
SText !Int String SimpleDoc 
SLine !Int SimpleDoc 
SSGR [SGR] SimpleDoc 

text :: String -> Doc #

group :: Doc -> Doc #

empty :: Doc #

nesting :: (Int -> Doc) -> Doc #

column :: (Int -> Doc) -> Doc #

linebreak :: Doc #

nest :: Int -> Doc -> Doc #

(<+>) :: Doc -> Doc -> Doc #

char :: Char -> Doc #

line :: Doc #

(<//>) :: Doc -> Doc -> Doc #

align :: Doc -> Doc #

(<$$>) :: Doc -> Doc -> Doc #

(</>) :: Doc -> 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 #

colon :: Doc #

comma :: Doc #

cyan :: Doc -> Doc #

debold :: Doc -> Doc #

deunderline :: Doc -> Doc #

displayIO :: Handle -> SimpleDoc -> IO () #

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 #

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 #

hPutDoc :: Handle -> Doc -> IO () #

hang :: Int -> Doc -> Doc #

hardline :: Doc #

hcat :: [Doc] -> Doc #

hsep :: [Doc] -> Doc #

int :: Int -> Doc #

integer :: Integer -> Doc #

langle :: Doc #

lbrace :: Doc #

lbracket :: Doc #

list :: [Doc] -> Doc #

lparen :: Doc #

magenta :: 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 #

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 #

tupled :: [Doc] -> Doc #

underline :: Doc -> Doc #

vcat :: [Doc] -> Doc #

vsep :: [Doc] -> Doc #

white :: Doc -> Doc #

width :: Doc -> (Int -> Doc) -> Doc #

yellow :: Doc -> Doc #

type Doc = Doc Source #

indent :: Int -> Doc -> Doc Source #

renderPretty :: Float -> Int -> Doc -> SimpleDoc Source #

(.$.) :: Doc -> Doc -> Doc Source #

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.