pPrint and pPrintLightBg will intelligently decide whether or not to use
ANSI escape codes for coloring depending on whether or not the output is
a TTY. This works in most cases. If you want to force color output,
you can use the pPrintForceColor or pPrintForceColorLightBg functions.
Similar to pShow, but the first argument is a String representing a
data type that has already been showed.
This will work on any String that is similar to a Haskell data type. The
only requirement is that the strings are quoted, and braces, parentheses, and
brackets are correctly used to represent indentation. For example,
pString will correctly pretty-print JSON.
This function is for printing to a dark background.
See pStringNoColor for an example of how to use this function.
Here, you can see that the character A has been printed as-is. x42
has been printed in the non-escaped version, B. The non-printable
character x1 has been printed as x1. Newlines will be removed to
make the output easier to read.
(Note that in the above and following examples, the characters have to be
double-escaped, which makes it somewhat confusing...)
Another output style is DoNotEscapeNonPrintable. This is similar
to EscapeNonPrintable, except that non-printable characters get printed
out literally to the screen.
If you change the above example to contain x1, you can see that it is
output as a literal, non-escaped character. Newlines are still removed
for readability.
Another output style is Literal. This just outputs all escape characters.
Output string literals by printing the source characters exactly.
For examples: without this option the printer will insert a newline in
place of "n", with this options the printer will output \ and
n. Similarly the exact escape codes used in the input string will be
replicated, so "65" will be printed as "65" and not A.
Determines whether pretty-simple should check if the output Handle is a
TTY device. Normally, users only want to print in color if the output
Handle is a TTY device.
A list of colors to use for rainbow parenthesis output. Use
'[]' if you don't want rainbow parenthesis. Use just a single item if you
want all the rainbow parenthesis to be colored the same.
Instances4Eq, Show, Generic, Rep
EqColorOptionsDefined in pretty-simple-4.1.3.0 · Text.Pretty.Simple.Internal.Color
ShowColorOptionsDefined in pretty-simple-4.1.3.0 · Text.Pretty.Simple.Internal.Color
GenericColorOptionsDefined in pretty-simple-4.1.3.0 · Text.Pretty.Simple.Internal.Color
>>> pPrintOpt CheckColorTty defaultOutputOptionsDarkBg {outputOptionsCompactParens = True} $ B ( C [A, A] [B A, B (B (B A))] )B ( C [ A , A ] [ B A , B ( B ( B A ) ) ] )