h$hxcl      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIX Safe-Inferred  #$38?  pretty-simpleWays to style terminal output. pretty-simple>These options are for colorizing the output of functions like pPrint.=If you don't want to use a color for one of the options, use . pretty-simple#Color to use for quote characters (") around strings. pretty-simpleColor to use for strings. pretty-simple*Color for errors, e.g. unmatched brackets. pretty-simpleColor to use for numbers. pretty-simpleA 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. pretty-simple3Default color options for use on a dark background. pretty-simple4Default color options for use on a light background. pretty-simple No styling.  (c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIX Safe-Inferred38? + pretty-simpleWe could store this as a , say, instead of a . However, we will never need to use its value for anything. Indeed, the only thing we will be doing with it is turning it back into a string at some stage, so we might as well cut out the middle man and store it directly like this. %+*)('&,-./ -./%+*)('&,(c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIX Safe-Inferred?/8 pretty-simple8 and 9 are convenient to use in GHCi when playing around with how parsing works.9 pretty-simpleSee 8.< pretty-simpleParse multiple expressions.parseExprs "Just 'a'" ([Other "Just ",CharLit "a"],"")#Handle escaped characters correctly'parseExprs $ "Foo \"hello \\\"world!\""0([Other "Foo ",StringLit "hello \\\"world!"],"")parseExprs $ "'\\''"([CharLit "\\'"],"")> pretty-simple4Parse string literals until a trailing double quote.parseStringLit "foobar\" baz"("foobar"," baz")Keep literal back slashes:'parseStringLit "foobar\\\" baz\" after"("foobar\\\" baz"," after")? pretty-simple7Parse character literals until a trailing single quote.parseCharLit "a' foobar"("a"," foobar")Keep literal back slashes:parseCharLit "\\'' hello"("\\'"," hello")@ pretty-simple Parses integers and reals, like 123 and 45.67.3To be more precise, any numbers matching the regex  \d+(\.\d+)?% should get parsed by this function.&parseNumberLit '3' "456hello world []"("3456","hello world []")%parseNumberLit '0' ".12399880 foobar"("0.12399880"," foobar")A pretty-simpleThis function consumes input, stopping only when it hits a special character or a digit. However, if the digit is in the middle of a Haskell-style identifier (e.g. foo123), then keep going anyway.'This is almost the same as the function parseOtherSimple = span $ \c -> notElem c ("{[()]}\"," :: String) && not (isDigit c) && (c /= '\'')except A ignores digits and single quotes that appear in Haskell-like identifiers.parseOther "hello world []"("hello world ","[]")parseOther "hello234 world"("hello234 world","")parseOther "hello 234 world"("hello ","234 world")parseOther "hello{[ 234 world"("hello","{[ 234 world")parseOther "H3110 World"("H3110 World","")&parseOther "Node' (Leaf' 1) (Leaf' 2)" ("Node' ","(Leaf' 1) (Leaf' 2)")parseOther "I'm One"("I'm One","")parseOther "I'm 2" ("I'm ","2") 89:;<=>?@A 89:;<=>?@A(c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIX Safe-Inferred  #$38?(%B pretty-simpleAn infinite listD pretty-simpleA bidirectional Turing-machine tape: infinite in both directions, with a head pointing to one element.F pretty-simplethe side of the D left of GG pretty-simplethe focused elementH pretty-simplethe side of the D right of GI pretty-simpleAn abstract annotation type, representing the various elements we may want to highlight.P pretty-simpleData-type wrapping up all the options available when rendering the list of Outputs.R pretty-simpleNumber of spaces to use when indenting. It should probably be either 2 or 4.S pretty-simple7The maximum number of characters to fit on to one line.T pretty-simple.Use less vertical (and more horizontal) space.U pretty-simple.Group closing parentheses on to a single line.V pretty-simple'Indent the whole output by this amount.W pretty-simple If this is /, then don't colorize the output. If this is  colorOptions , then use  colorOptions to colorize the output.X pretty-simple(Controls how string literals are output.By default, the pPrint functions escape non-printable characters, but print all printable characters:+pPrintString "\"A \\x42  \\xC4 \\x1 \\n\"" "A B   \x1"%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.This corresponds to the Y called [.(Note that in the above and following examples, the characters have to be double-escaped, which makes it somewhat confusing...)Another output style is \. This is similar to [, except that non-printable characters get printed out literally to the screen.pPrintStringOpt CheckColorTty defaultOutputOptionsDarkBg{ outputOptionsStringStyle = DoNotEscapeNonPrintable } "\"A \\x42  \\xC4 \\n\"""A B  "+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 Z+. This just outputs all escape characters.pPrintStringOpt CheckColorTty defaultOutputOptionsDarkBg{ outputOptionsStringStyle = Literal } "\"A \\x42  \\xC4 \\x1 \\n\"""A \x42  \xC4 \x1 \n"You can see that all the escape characters get output literally, including newline.Y pretty-simple=Control how escaped and non-printable are output for strings.See X< for what the output looks like with each of these options.Z pretty-simpleOutput 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.[ pretty-simpleReplace non-printable characters with hexadecimal escape sequences.\ pretty-simple5Output non-printable characters without modification.] pretty-simple when printing using using ANSI escape sequences for color. R is 4, and W is .c pretty-simpleGiven P, disable colorful output if the given handle is not connected to a TTY.d pretty-simpleParse a string, and generate an intermediate representation, suitable for passing to any  prettyprinter backend. Used by  etc.e pretty-simpleSlight adjustment of f9 for the outermost level, to avoid indenting everything.f pretty-simple Construct a  from multiple %s.g pretty-simple Construct a  from a single %.h pretty-simpleDetermine whether this expression should be displayed on a single line.i pretty-simpleTraverse the stream, using a D$ to keep track of the current style.j pretty-simple;Replace non-printable characters with hex escape sequences.escapeNonPrintable "\x1\x2" "\\x1\\x2"Newlines will not be escaped.!escapeNonPrintable "hello\nworld""hello\nworld")Printable characters will not be escaped.escapeNonPrintable "h\101llo""hello"k pretty-simpleReplace an unprintable character except a newline with a hex escape sequence.l pretty-simpleMove the head leftm pretty-simpleMove the head rightn pretty-simple Analogous to o pretty-simple Analogous to  While the inferred signature here is more general, it would diverge on an empty structure.BCDEHFGILKJMONPQXWVUTSRY\[Z]_^`abcdefghijklmno.]_^Y\[ZPQXWVUTSR`abcdefghiILKJMONjkDEHFGlmBCno (c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIX Safe-Inferred) %+*)(',&-./89:;<=>?@ABCDEHGFILKJMNOPQXWVUTRSY\Z[]^_`abcdefghijklmno(c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIX Safe-Inferred ?F*{ pretty-simple&Pretty-print any data type that has a  instance.If you've never seen  before, you can think of this function as having the following type signature:  pPrint :: Show a => a -> IO () This function will only use colors if it detects it's printing to a TTY.9This function is for printing to a dark background. Use  for printing to a terminal with a light background. Different colors are used. Prints to . Use | to print to a different .pPrint [Just (1, "hello")][ Just ( 1 , "hello" )]| pretty-simple Similar to { , but take a  to print to."pHPrint stdout [Just (1, "hello")][ Just ( 1 , "hello" )]} pretty-simple Similar to {, but the first argument is a 1 representing a data type that has already been ed.2pPrintString $ show [ Just (1, "hello"), Nothing ][ Just ( 1 , "hello" ) , Nothing]~ pretty-simple Similar to ~ , but take a  to print to.:pHPrintString stdout $ show [ Just (1, "hello"), Nothing ][ Just ( 1 , "hello" ) , Nothing] pretty-simple Similar to {, but print in color regardless of whether the output goes to a TTY or not.See {, for an example of how to use this function. pretty-simple Similar to  , but take a  to print to.See |, for an example of how to use this function. pretty-simple Similar to }, but print in color regardless of whether the output goes to a TTY or not.See }, for an example of how to use this function. pretty-simple Similar to ~, but print in color regardless of whether the output goes to a TTY or not.See ~, for an example of how to use this function. pretty-simple Similar to ?, but just return the resulting pretty-printed data type as a & instead of printing it to the screen.3This function is for printing to a dark background.See , for an example of how to use this function. pretty-simple Similar to , but the first argument is a 1 representing a data type that has already been ed.This will work on any  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, " will correctly pretty-print JSON.3This function is for printing to a dark background.See , for an example of how to use this function. pretty-simple Alias for {. pretty-simple Alias for |. pretty-simple Alias for }. pretty-simple Alias for ~. pretty-simple Alias for . pretty-simple Alias for . pretty-simple Alias for . pretty-simple Alias for . pretty-simple Alias for . pretty-simple Alias for . pretty-simple Just like ), but for printing to a light background. pretty-simple Just like ), but for printing to a light background. pretty-simple Just like ), but for printing to a light background. pretty-simple Just like ), but for printing to a light background. pretty-simple Just like *, but for printing to a light background. pretty-simple Just like *, but for printing to a light background. pretty-simple Just like *, but for printing to a light background. pretty-simple Just like *, but for printing to a light background. pretty-simple Just like ), but for printing to a light background. pretty-simple Just like ), but for printing to a light background. pretty-simple Similar to {, but doesn't print in color. However, data types will still be indented nicely.%pPrintNoColor $ Just ["hello", "bye"]Just [ "hello" , "bye" ] pretty-simpleLike  , but take a  to determine where to print to.-pHPrintNoColor stdout $ Just ["hello", "bye"]Just [ "hello" , "bye" ] pretty-simple Similar to }, but doesn't print in color. However, data types will still be indented nicely.2pPrintStringNoColor $ show $ Just ["hello", "bye"]Just [ "hello" , "bye" ] pretty-simpleLike  , but take a  to determine where to print to.:pHPrintStringNoColor stdout $ show $ Just ["hello", "bye"]Just [ "hello" , "bye" ] pretty-simpleLike , but without color.+pShowNoColor [ Nothing, Just (1, "hello") ]7"[ Nothing\n, Just\n ( 1\n , \"hello\"\n )\n]" pretty-simpleLIke , but without color.pStringNoColor $ show [1, 2, 3]"[ 1\n, 2\n, 3\n]" pretty-simple Similar to { but takes P, to change how the pretty-printing is done. For example, ? can be used to make the indentation much smaller than normal./This is what the normal indentation looks like:pPrintOpt NoCheckColorTty defaultOutputOptionsNoColor $ Just ("hello", "bye")Just ( "hello" , "bye" ),This is what smaller indentation looks like:let smallIndent = defaultOutputOptionsNoColor {outputOptionsIndentAmount = 1};pPrintOpt CheckColorTty smallIndent $ Just ("hello", "bye")Just ( "hello" , "bye" )Lines in strings get indentedpPrintOpt NoCheckColorTty defaultOutputOptionsNoColor (1, (2, "foo\nbar\nbaz", 3)) ( 1, ( 2 , "foo bar baz" , 3 ))0Lines get indented even in custom show instancesdata Foo = Foo0instance Show Foo where show _ = "foo\nbar\nbaz"pPrintOpt CheckColorTty defaultOutputOptionsNoColor (1, (2, Foo, 3)) ( 1, ( 2 , foo bar baz , 3 ))] determines whether to test . for whether or not it is connected to a TTY. If set to _, then  won't check if > is a TTY. It will print in color depending on the value of W. If set to ], then  will check if  is conneted to a TTY. If  is determined to be connected to a TTY, then it will print in color depending on the value of W. If  is determined to NOT be connected to a TTY, then it will NOT print in color, regardless of the value of W. pretty-simple Similar to  , but take a ! to determine where to print to. pretty-simple Similar to , but the last argument is a string representing a data structure that has already been ed.#let foo = show (1, (2, "hello", 3))=pPrintStringOpt CheckColorTty defaultOutputOptionsNoColor foo( 1, ( 2 , "hello" , 3 )) pretty-simple Similar to  , but take a ! to determine where to print to.#let foo = show (1, (2, "hello", 3))pHPrintStringOpt CheckColorTty defaultOutputOptionsNoColor stdout foo( 1, ( 2 , "hello" , 3 )) pretty-simpleLike  but takes P, to change how the pretty-printing is done. pretty-simpleLike  but takes P, to change how the pretty-printing is done. PQRSTUVWXYZ[\]^_`ab{|}~{|}~PQRSTUVWXYZ[\`ab]^_  (c) Dennis Gosnell, 2017BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIXNoneb0 pretty-simpleThe  function outputs the trace message from the IO monad. This sequences the output with respect to other IO actions. pretty-simpleThe  function pretty prints the trace message given as its first argument, before returning the second argument as its result.'For example, this returns the value of f x but first outputs the message. .pTrace ("calling f with x = " ++ show x) (f x)The  function should only be used for debugging, or for monitoring execution. The function is not referentially transparent: its type indicates that it is a pure function but it has the side effect of outputting the trace message. pretty-simpleLike 2 but returns the message instead of a third value. pretty-simpleLike  , but uses $ on the argument to convert it to a .This makes it convenient for printing the values of interesting variables or expressions inside a function. For example here we print the value of the variables x and z: f x y = pTraceShow (x, z) $ result where z = ... ... pretty-simpleLike 6 but returns the shown value instead of a third value. pretty-simpleLike $ but returning unit in an arbitrary 3 context. Allows for convenient use in do-notation.Note that the application of  is not an action in the  context, as  is in the  type. While the fresh bindings in the following example will force the * expressions to be reduced every time the do-block is executed, traceM "not crashed" would only be reduced once, and the message would only be printed once. If your monad is in MonadIO, liftIO . pTraceIO may be a better option. ... = do x <- ... pTraceM $ "x: " ++ show x y <- ... pTraceM $ "y: " ++ show y pretty-simpleLike  , but uses $ on the argument to convert it to a . ... = do x <- ... pTraceShowM $ x y <- ... pTraceShowM $ x + y pretty-simplelike ;, but additionally prints a call stack if one is available.In the current GHC implementation, the call stack is only available if the program was compiled with -prof ; otherwise  behaves exactly like +. Entries in the call stack correspond to SCC* annotations, so it is a good idea to use  -fprof-auto or -fprof-auto-calls& to add SCC annotations automatically. pretty-simpleThe  function behaves like  with the difference that the message is emitted to the eventlog, if eventlog profiling is available and enabled at runtime.:It is suitable for use in pure code. In an IO context use  instead.Note that when using GHC's SMP runtime, it is possible (but rare) to get duplicate events emitted if two CPUs simultaneously evaluate the same thunk that uses . pretty-simpleThe  function emits a message to the eventlog, if eventlog profiling is available and enabled at runtime. Compared to , 6 sequences the event with respect to other IO actions. pretty-simpleThe  function emits a marker to the eventlog, if eventlog profiling is available and enabled at runtime. The String is the name of the marker. The name is just used in the profiling tools to help you keep clear which marker is which.This function is suitable for use in pure code. In an IO context use  instead.Note that when using GHC's SMP runtime, it is possible (but rare) to get duplicate events emitted if two CPUs simultaneously evaluate the same thunk that uses . pretty-simpleThe  function emits a marker to the eventlog, if eventlog profiling is available and enabled at runtime. Compared to , 7 sequences the event with respect to other IO actions. pretty-simple Similar to , but forcing color. pretty-simple Similar to , but forcing color. pretty-simple Similar to , but forcing color. pretty-simple Similar to , but forcing color. pretty-simple Similar to , but forcing color. pretty-simple Similar to , but forcing color. pretty-simple Similar to , but forcing color. pretty-simple Similar to , but forcing color. pretty-simple Similar to , but forcing color. pretty-simple Similar to , but forcing color. pretty-simple Similar to , but forcing color. pretty-simple Similar to , but forcing color. pretty-simple Similar to , but without color.pTraceNoColor "wow" ()wow() pretty-simple Similar to , but without color.$pTraceIdNoColor "(1, 2, 3)" `seq` ()( 1, 2, 3)() pretty-simple Similar to , but without color.import qualified Data.Map as M-pTraceShowNoColor (M.fromList [(1, True)]) ()fromList [ ( 1 , True ) ]() pretty-simple Similar to , but without color.import qualified Data.Map as M5pTraceShowIdNoColor (M.fromList [(1, True)]) `seq` ()fromList [ ( 1 , True ) ]() pretty-simple Similar to , but without color.pTraceMNoColor "wow"wow pretty-simple Similar to , but without color.pTraceShowMNoColor [1,2,3][ 1, 2, 3] pretty-simple Similar to , but without color.$pTraceStackNoColor "wow" () `seq` ()wow() pretty-simple Similar to , but without color. pretty-simple Similar to , but without color. pretty-simple Similar to , but without color. pretty-simple Similar to , but without color. pretty-simple Similar to , but without color.pTraceIONoColor "(1, 2, 3)"( 1, 2, 3) pretty-simpleLike  but takes OutputOptions. pretty-simpleLike  but takes OutputOptions. pretty-simpleLike  but takes OutputOptions. pretty-simpleLike  but takes OutputOptions. pretty-simpleLike  but takes OutputOptions. pretty-simpleLike  but takes OutputOptions. pretty-simpleLike  but takes OutputOptions. pretty-simpleLike  but takes OutputOptions. pretty-simpleLike  but takes OutputOptions. pretty-simpleLike  but takes OutputOptions. pretty-simpleLike  but takes OutputOptions. pretty-simpleLike  but takes OutputOptions.00             !"#$%&'()*+,-./01234567789:;<=>?@ABCDEFGHIJKLMMNOPQRSTUVWXXYZ[\]^_`abcddefghijklmnopqrstuvwxyz{|}~V,pretty-simple-4.1.0.0-6JVpgDaeo6dIIbOhfAEnUhText.Pretty.Simple!Text.Pretty.Simple.Internal.Color Text.Pretty.Simple.Internal.Expr&Text.Pretty.Simple.Internal.ExprParser#Text.Pretty.Simple.Internal.PrinterDebug.Pretty.SimpleSimplepStringText.Pretty.Simple.Internal7prettyprinter-ansi-terminal-1.1.3-gZx3n0oqoxLWcFflcwWAQ&Prettyprinter.Render.Terminal.InternalWhiteCyanMagentaBlueYellowGreenRedBlackColorDullVivid IntensityStyle styleColor styleBold styleItalicstyleUnderlined ColorOptions colorQuote colorString colorErrorcolorNumcolorRainbowParensdefaultColorOptionsDarkBgdefaultColorOptionsLightBg colorNullcolor colorBold convertStyle$fEqColorOptions$fGenericColorOptions$fShowColorOptions $fEqStyle$fGenericStyle $fShowStyleExprBracketsBracesParens StringLitCharLit NumberLitOtherCommaSeparatedunCommaSeparated $fDataExpr$fEqExpr $fGenericExpr $fShowExpr$fDataCommaSeparated$fEqCommaSeparated$fGenericCommaSeparated$fShowCommaSeparated testString1 testString2expressionParse parseExpr parseExprs parseCSepparseStringLit parseCharLitparseNumberLit parseOtherStream:..TapetapeLefttapeHead tapeRight AnnotationOpenCloseCommaQuoteStringNum OutputOptionsoutputOptionsIndentAmountoutputOptionsPageWidthoutputOptionsCompactoutputOptionsCompactParensoutputOptionsInitialIndentoutputOptionsColorOptionsoutputOptionsStringStyleStringOutputStyleLiteralEscapeNonPrintableDoNotEscapeNonPrintable CheckColorTtyNoCheckColorTtydefaultOutputOptionsDarkBgdefaultOutputOptionsLightBgdefaultOutputOptionsNoColor hCheckTTY layoutString prettyExprs' prettyExprs prettyExprisSimple annotateStyleescapeNonPrintableescapemoveLmoveR streamRepeat streamCycle $fShowTape $fShowStream$fEqOutputOptions$fGenericOutputOptions$fShowOutputOptions$fEqStringOutputStyle$fGenericStringOutputStyle$fShowStringOutputStyle$fEqCheckColorTty$fGenericCheckColorTty$fShowCheckColorTtypPrintpHPrint pPrintString pHPrintStringpPrintForceColorpHPrintForceColorpPrintStringForceColorpHPrintStringForceColorpShow pPrintDarkBg pHPrintDarkBgpPrintStringDarkBgpHPrintStringDarkBgpPrintForceColorDarkBgpHPrintForceColorDarkBgpPrintStringForceColorDarkBgpHPrintStringForceColorDarkBg pShowDarkBg pStringDarkBg pPrintLightBgpHPrintLightBgpPrintStringLightBgpHPrintStringLightBgpPrintForceColorLightBgpHPrintForceColorLightBgpPrintStringForceColorLightBgpHPrintStringForceColorLightBg pShowLightBgpStringLightBg pPrintNoColorpHPrintNoColorpPrintStringNoColorpHPrintStringNoColor pShowNoColorpStringNoColor pPrintOpt pHPrintOptpPrintStringOptpHPrintStringOptpShowOpt pStringOptpTraceIOpTracepTraceId pTraceShow pTraceShowIdpTraceM pTraceShowM pTraceStack pTraceEvent pTraceEventIO pTraceMarkerpTraceMarkerIOpTraceForceColorpTraceIdForceColorpTraceShowForceColorpTraceShowIdForceColorpTraceMForceColorpTraceShowMForceColorpTraceStackForceColorpTraceEventForceColorpTraceEventIOForceColorpTraceMarkerForceColorpTraceMarkerIOForceColorpTraceIOForceColor pTraceNoColorpTraceIdNoColorpTraceShowNoColorpTraceShowIdNoColorpTraceMNoColorpTraceShowMNoColorpTraceStackNoColorpTraceEventNoColorpTraceEventIONoColorpTraceMarkerNoColorpTraceMarkerIONoColorpTraceIONoColor pTraceOpt pTraceIdOpt pTraceShowOptpTraceShowIdOpt pTraceOptIO pTraceOptMpTraceShowOptMpTraceStackOptpTraceEventOptpTraceEventOptIOpTraceMarkerOptpTraceMarkerOptIObaseGHC.RealRationalGHC.Base GHC.MaybeNothingJustGHC.IO.Handle.TypesHandle)prettyprinter-1.7.1-BauxLiNvN3EiJKyXe93SMPrettyprinter.InternalDocGHC.ListrepeatcycleGHC.ShowShowControl.Monad.IO.ClassMonadIOGHC.IO.Handle.FDstdoutshow text-1.2.3.2Data.Text.Internal.LazyText Applicativeghc-prim GHC.TypesIO Debug.TracetraceMtrace