|
|
|
|
| Synopsis |
|
|
|
| Documentation |
|
| cr :: Doc |
|
| dollar :: Doc |
|
| errorDoc :: Doc -> a |
|
| traceDoc :: Doc -> a -> a |
|
| assertDoc :: Maybe Doc -> a -> a |
|
| data Policy |
| the Policy type is a record containing the variables which control
how Docs will be rendered on some output.
| | Constructors | | Policy | | | poColor :: Bool | overall use of color
| | poEscape :: Bool | overall use of escaping
| | poLineColor :: Bool | overall use of colored lines (only hunks for now)
| | poAltColor :: Bool | alternative to color (bold, inverse)
| | poIsprint :: Bool | don't escape isprints
| | po8bit :: Bool | don't escape 8-bit chars
| | poNoEscX :: String | extra chars to never escape
| | poEscX :: String | extra chars to always escape
| | poTrailing :: Bool | escape trailing spaces
| | poCR :: Bool | ignore r at end of lines
| | poSpace :: Bool | escape spaces (used with poTrailing)
|
|
|
|
|
| getPolicy :: Handle -> Policy |
| getPolicy returns a suitable policy for a given handle.
The policy is chosen according to environment variables, and to the
type of terminal which the handle represents
|
|
| fancyPrinters :: Printers |
| fancyPrinters h returns a set of printers suitable for outputting
to h
|
|
| lineColorTrans :: Policy -> Color -> Doc -> Doc |
| lineColorTrans policy tries to color a Doc, according to policy po.
That is, if policy has poLineColor set, then colors the line, otherwise
does nothing.
|
|
| lineColorSuffix :: Policy -> [Printable] -> [Printable] |
|
| colorPrinter :: Policy -> Color -> Printer |
|
| userchunkPrinter :: Policy -> Printer |
|
| escapePrinter :: Policy -> Printer |
|
| escape :: Policy -> String -> Doc |
| escape policy string escapes string according to the rules
defined in policy, turning it into a Doc.
|
|
| no_escape :: Policy -> Char -> Bool |
| no_escape policy c tells wether c will be left as-is
when escaping according to policy
|
|
| isPrintableAscii :: Char -> Bool |
| isPrintableAscii tells wether a character is a printable character
of the ascii range.
|
|
| quoteChar :: Char -> String |
| quoteChar represents a special character as a string.
* quoteChar '^c' (where ^c is a control character) is ^c
* Otherwise, quoteChar returns hex, where hex is the
hexadecimal number of the character.
|
|
| mark_escape :: Policy -> Doc -> Doc |
| mark_escape policy doc marks doc with the appropriate
marking for escaped characters according to policy
|
|
| color :: Policy -> Color -> Doc -> Doc |
| color policy color doc colors doc with color color if
policy is not set to use an alternative to color. In that case,
it makes the text bold instead.
|
|
| make_color' :: Color -> Doc -> Doc |
|
| make_color :: Color -> Doc -> Doc |
|
| set_color :: Color -> String |
|
| make_asciiart :: Doc -> Doc |
| make_asciiart doc tries to make doc (usually a
single escaped char) stand out with the help of only plain
ascii, i.e., no color or font style.
|
|
| reset_color :: String |
| the string to reset the terminal's color.
|
|
| with_color :: String -> Doc -> Doc |
| with_color color doc returns a colorized version of doc.
color is a string that represents a color, given by set_color
|
|
| make_bold :: Doc -> Doc |
| make_bold boldens a doc.
|
|
| make_invert :: Doc -> Doc |
| make_invert returns an invert video version of a doc.
|
|
| Produced by Haddock version 2.4.2 |