!5'.      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ (c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIXNone 16<QV, pretty-simple>These options are for colorizing the output of functions like pPrint.For example, if you set  to something like , then the quote character ("() will be output as bright blue in bold.=If you don't want to use a color for one of the options, use 5. pretty-simple#Color to use for quote characters (") around strings. pretty-simpleColor to use for strings. pretty-simple(currently not used) pretty-simple(currently not used) pretty-simple 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. pretty-simple3Default color options for use on a dark background. is .  is  .  is  .  is  .  is defaultColorRainboxParensDarkBg. pretty-simpleDefault color for  for dark backgrounds. This is .  pretty-simpleDefault color for  for dark backgrounds. This is .  pretty-simpleDefault color for ! for dark backgrounds. This is .  pretty-simpleDefault color for ! for dark backgrounds. This is .  pretty-simpleDefault colors for  for dark backgrounds.  pretty-simple4Default color options for use on a light background. is .  is .  is .  is .  is  defaultColorRainboxParensLightBg. pretty-simpleDefault color for ! for light backgrounds. This is . pretty-simpleDefault color for ! for light backgrounds. This is . pretty-simpleDefault color for " for light backgrounds. This is . pretty-simpleDefault color for " for light backgrounds. This is . pretty-simpleDefault colors for  for light backgrounds.3 pretty-simpleChange the intensity to .4 pretty-simple" the console color back to normal.5 pretty-simple Empty string.6 pretty-simpleHelper for creating a / for an ANSI escape sequence color based on a  and a .7 pretty-simpleConvert a list of  to a .8  !"#$%&'()*+,-./012345678  !"#$%&'()*+,-./01234567(c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIXNone 16<QV0T ;?>=<@ABC ABC;?>=<@(c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIXNone 16<QV@}V pretty-simple,Parse brackets around a list of expressions.(test bracketsExpr "[hello\"what\", foo]"gRight (Brackets (CommaSeparated {unCommaSeparated = [[Other "hello",StringLit "what"],[Other "foo"]]}))test bracketsExpr "[[] ]"vRight (Brackets (CommaSeparated {unCommaSeparated = [[Brackets (CommaSeparated {unCommaSeparated = []}),Other " "]]}))[ pretty-simpleParse a string literal."test stringLiteralExpr "\"hello\""Right (StringLit "hello"),isLeft $ test stringLiteralExpr " \"hello\""True] pretty-simple<Parse anything that doesn't get parsed by the parsers above.test anyOtherText " Foo "Right (Other " Foo ")Parse empty strings.test anyOtherText " "Right (Other " ")Stop parsing if we hit [, ], (, ), {, }, ", or ,.test anyOtherText "hello["Right (Other "hello")Don't parse the empty string.isLeft $ test anyOtherText ""TrueisLeft $ test anyOtherText ","TrueLMNOPQRSTUVWXYZ[\]^_`LMNOPQRSTUVWXYZ[\]^_`(c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIXNone.16<FKQTVWa pretty-simpleAn e token together with a q. Basically, each e keeps track of its own q.e pretty-simpleCThese are the output tokens that we will be printing to the screen.f pretty-simpleThis represents the } character.g pretty-simpleThis represents the ] character.h pretty-simpleThis represents the ) character.i pretty-simpleThis represents the , character.j pretty-simpleThis represents an indentation.k pretty-simpleThis represents the \n character.l pretty-simpleThis represents the { character.m pretty-simpleThis represents the [ character.n pretty-simpleThis represents the ( character.o pretty-simple[This represents some collection of characters that don't fit into any of the other tokens.p pretty-simple1This represents a string literal. For instance, "foobar".q pretty-simple3Datatype representing how much something is nested.For example, a q of 0 would mean an a8 token is at the very highest level, not in any braces.A q of 1 would mean that an a! token is in one single pair of { and }, or [ and ], or @ and @@.A q of 2 would mean that an a' token is two levels of brackets, etc.t pretty-simple (and W) should generally only be used in tests and debugging. There is no way to represent j and p.abdceponmlkjihgfqrsqrseponmlkjihgfabdc(c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIXNone 16<FKQTV|  pretty-simpleNewtype around 4 to represent a line number. After a newline, the  will increase by 1. pretty-simpleSmart-constructor for . pretty-simple%Print a surrounding expression (like [] or {} or ()).If the A> expressions are empty, just print the start and end markers.6testInit $ putSurroundExpr "[" "]" (CommaSeparated [])/PrinterState {currLine = LineNum {unLineNum = 0}, nestLevel = NestLevel {unNestLevel = -1}, outputList = fromList [Output {outputNestLevel = NestLevel {unNestLevel = 0}, outputOutputType = OutputOpenBracket},Output {outputNestLevel = NestLevel {unNestLevel = 0}, outputOutputType = OutputCloseBracket}]}If there is only one expression, and it will print out on one line, then just print everything all on one line, with spaces around the expressions.EtestInit $ putSurroundExpr "{" "}" (CommaSeparated [[Other "hello"]])@PrinterState {currLine = LineNum {unLineNum = 0}, nestLevel = NestLevel {unNestLevel = -1}, outputList = fromList [Output {outputNestLevel = NestLevel {unNestLevel = 0}, outputOutputType = OutputOpenBrace},Output {outputNestLevel = NestLevel {unNestLevel = 0}, outputOutputType = OutputOther " "},Output {outputNestLevel = NestLevel {unNestLevel = 0}, outputOutputType = OutputOther "hello"},Output {outputNestLevel = NestLevel {unNestLevel = 0}, outputOutputType = OutputOther " "},Output {outputNestLevel = NestLevel {unNestLevel = 0}, outputOutputType = OutputCloseBrace}]}~If there is only one expression, but it will print out on multiple lines, then go to newline and print out on multiple lines.1 + 1 -- TODO: Example here.2\If there are multiple expressions, then first go to a newline. Print out on multiple lines.1 + 1 -- TODO: Example here.2 pretty-simpleMA function that performs optimizations and modifications to a list of input ;s. An sample of an optimization is ' which removes empty inner lists in a A value. pretty-simple(Remove empty lists from a list of lists.$removeEmptyList [[1,2,3], [], [4,5]][[1,2,3],[4,5]]removeEmptyList [[]][]removeEmptyList [[1]][[1]]+removeEmptyList [[1,2], [10,20], [100,200]][[1,2],[10,20],[100,200]] pretty-simple!comma separated inner expression.(c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIXNone $16<QVT pretty-simpleLData-type wrapping up all the options available when rendering the list of as. pretty-simpleNNumber of spaces to use when indenting. It should probably be either 2 or 4. pretty-simple If this is /, then don't colorize the output. If this is  colorOptions , then use  colorOptions to colorize the output. pretty-simpleDefault values for 6 when printing to a console with a dark background.  is 4, and  is . pretty-simpleDefault values for 7 when printing to a console with a light background.  is 4, and  is  . pretty-simpleDefault values for > when printing using using ANSI escape sequences for color.  is 4, and  is . pretty-simpleGiven  and a list of a , turn the a into a lazy . pretty-simpleTurn a list of a into a &, using the options specified in the . pretty-simpleRender a single a as a &, using the options specified in the . pretty-simple$indentSubsequentLinesWith " " "aaa""aaa".indentSubsequentLinesWith " " "aaa\nbbb\nccc""aaa\n bbb\n ccc"!indentSubsequentLinesWith " " """" pretty-simple Produce a B corresponding to the ANSI escape sequence for the color for the ", based on whether or not  is  or , and the value of . pretty-simple Produce a s corresponding to the ANSI escape sequence for the color for the characters of a string, based on whether or not  is  or , and the value of . pretty-simple Produce a s corresponding to the ANSI escape sequence for resetting the console color back to the default. Produces an empty  if  is . pretty-simple Produce a a representing the ANSI escape sequence for the color of the rainbow parenthesis, given an input q and  to use as the input character.If  is 3, then just return the input character. If it is ,, then return the input character colorized. pretty-simpleThis is simply    . pretty-simpleMA function that performs optimizations and modifications to a list of input as. An sample of an optimization is = which just removes a newline if it is the first item in an a list. pretty-simple Remove a k if it is the first item in the a list.DremoveStartingNewLine [Output 3 OutputNewLine, Output 3 OutputComma]X[Output {outputNestLevel = NestLevel {unNestLevel = 3}, outputOutputType = OutputComma}] pretty-simpleIf there are two subsequent o% tokens, combine them into just one o.KcompressOthers [Output 0 (OutputOther "foo"), Output 0 (OutputOther "bar")]a[Output {outputNestLevel = NestLevel {unNestLevel = 0}, outputOutputType = OutputOther "foobar"}] pretty-simpleIn each o> token, compress multiple whitespaces to just one whitespace.=shrinkWhitespaceInOthers [Output 0 (OutputOther " hello ")]b[Output {outputNestLevel = NestLevel {unNestLevel = 0}, outputOutputType = OutputOther " hello "}] (c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIXNone  !"#$%&'()*+,-./01234567;@<=>?ABCLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrs(c) Dennis Gosnell, 2016BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIXNone 16<QVخ pretty-simple&Pretty-print any data type that has a  instance.If you've never seen P before, you can think of this function as having the following type signature:  pPrint :: Show a => a -> IO () 3This function is for printing to a dark background. 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. 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. 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 Similar to R, but doesn't print in color. However, data types will still be indented nicely.%pPrintNoColor $ Just ["hello", "bye"]Just [ "hello" , "bye" ] pretty-simpleLike , but without color. pretty-simpleLIke , but without color. pretty-simple Similar to  but takes , 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 defaultOutputOptionsNoColor $ Just ("hello", "bye")Just ( "hello" , "bye" ),This is what smaller indentation looks like:Mlet smallIndent = defaultOutputOptionsNoColor {outputOptionsIndentAmount = 1}-pPrintOpt smallIndent $ Just ("hello", "bye")Just ( "hello" , "bye" )Lines in strings get indentedBpPrintOpt 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"6pPrintOpt defaultOutputOptionsNoColor (1, (2, Foo, 3)) ( 1, ( 2 , foo bar baz , 3 )) pretty-simpleLike  but takes , to change how the pretty-printing is done. pretty-simpleLike  but takes , to change how the pretty-printing is done.  (c) Dennis Gosnell, 2017BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIXNone&j pretty-simpleThe r function outputs the trace message from the IO monad. This sequences the output with respect to other IO actions. pretty-simpleThe z 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: Bf 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 H 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. V... = do x <- ... pTraceM $ "x: " ++ show x y <- ... pTraceM $ "y: " ++ show y pretty-simpleLike  , but uses $ on the argument to convert it to a . F... = do x <- ... pTraceShowM $ x y <- ... pTraceShowM $ x + y pretty-simplelike ;, but additionally prints a call stack if one is available.eIn 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 e 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 j function emits a marker to the eventlog, if eventlog profiling is available and enabled at runtime. The Stringx is the name of the marker. The name is just used in the profiling tools to help you keep clear which marker is which.FThis 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 e 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 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)       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJJKLMNOPQRSTUVWXYZ[\]^_`abcdefghiijklmnopqrstuvwxxyz{|}~     ,pretty-simple-2.1.0.1-LsGvFQ3g9IN3wIi0t67Glk!Text.Pretty.Simple.Internal.Color Text.Pretty.Simple.Internal.Expr&Text.Pretty.Simple.Internal.ExprParser"Text.Pretty.Simple.Internal.Output(Text.Pretty.Simple.Internal.ExprToOutput)Text.Pretty.Simple.Internal.OutputPrinterText.Pretty.SimpleDebug.Pretty.SimpleText.Pretty.Simple.Internal ColorOptions colorQuote colorString colorErrorcolorNumcolorRainbowParensdefaultColorOptionsDarkBgdefaultColorQuoteDarkBgdefaultColorStringDarkBgdefaultColorErrorDarkBgdefaultColorNumDarkBgdefaultColorRainbowParensDarkBgdefaultColorOptionsLightBgdefaultColorQuoteLightBgdefaultColorStringLightBgdefaultColorErrorLightBgdefaultColorNumLightBg defaultColorRainbowParensLightBgcolorVividBlackBoldcolorVividBlueBoldcolorVividCyanBoldcolorVividGreenBoldcolorVividMagentaBoldcolorVividRedBoldcolorVividWhiteBoldcolorVividYellowBoldcolorDullBlackBoldcolorDullBlueBoldcolorDullCyanBoldcolorDullGreenBoldcolorDullMagentaBoldcolorDullRedBoldcolorDullWhiteBoldcolorDullYellowBoldcolorVividBlackcolorVividBluecolorVividCyancolorVividGreencolorVividMagenta colorVividRedcolorVividWhitecolorVividYellowcolorDullBlack colorDullBlue colorDullCyancolorDullGreencolorDullMagenta colorDullRedcolorDullWhitecolorDullYellow colorBold colorReset colorNull colorHelpersetSGRCodeBuilder$fEqColorOptions$fGenericColorOptions$fShowColorOptionsExprBracketsBracesParens StringLitOtherCommaSeparatedunCommaSeparated$fDataCommaSeparated$fEqCommaSeparated$fGenericCommaSeparated$fShowCommaSeparated $fDataExpr$fEqExpr $fGenericExpr $fShowExprParserlexer stringLiteralbracketsbracesparenscommaSeplexemeexprexpr' bracketsExpr bracesExpr parensExprrecursiveSurroundingExpr recursiveExprstringLiteralExprnonRecursiveExpr anyOtherText testString1 testString2expressionParseOutputoutputNestLeveloutputOutputType OutputTypeOutputCloseBraceOutputCloseBracketOutputCloseParen OutputComma OutputIndent OutputNewLineOutputOpenBraceOutputOpenBracketOutputOpenParen OutputOtherOutputStringLit NestLevel unNestLevel$fIsStringOutputType$fDataNestLevel $fEqNestLevel$fGenericNestLevel$fNumNestLevel$fOrdNestLevel$fReadNestLevel$fShowNestLevel$fDataOutputType$fEqOutputType$fGenericOutputType$fReadOutputType$fShowOutputType $fDataOutput $fEqOutput$fGenericOutput $fReadOutput $fShowOutput PrinterStatecurrLine nestLevel outputListLineNum unLineNum printerStateaddToOutputList addOutput addOutputsinitPrinterStateputSurroundExpr putCommaSepputComma howManyLinesdoIndentnewLinenewLineAndDoIndentaddToNestLeveladdToCurrentLine putExpressionrunPrinterStaterunInitPrinterStateexpressionsToOutputsmodificationsExprList&removeEmptyInnerCommaSeparatedExprList"removeEmptyInnerCommaSeparatedExprremoveEmptyInnerCommaSeparatedremoveEmptyList $fDataLineNum $fEqLineNum$fGenericLineNum $fNumLineNum $fOrdLineNum $fReadLineNum $fShowLineNum$fEqPrinterState$fDataPrinterState$fGenericPrinterState$fShowPrinterState OutputOptionsoutputOptionsIndentAmountoutputOptionsColorOptionsdefaultOutputOptionsDarkBgdefaultOutputOptionsLightBgdefaultOutputOptionsNoColorrender renderOutputs renderOutputindentSubsequentLinesWith useColorQuoteuseColorString useColorError useColorNum useColorResetrenderRaibowParenForuseColorRainbowParens sequenceFoldmodificationsOutputListremoveStartingNewLinecompressOthersshrinkWhitespaceInOthersshrinkWhitespaceInOthershrinkWhitespace$fEqOutputOptions$fGenericOutputOptions$fShowOutputOptionspPrintpShowpString pPrintDarkBg pShowDarkBg pStringDarkBg pPrintLightBg pShowLightBgpStringLightBg pPrintNoColor pShowNoColorpStringNoColor pPrintOptpShowOpt pStringOptpTraceIOpTracepTraceId pTraceShow pTraceShowIdpTraceM pTraceShowM pTraceStack pTraceEvent pTraceEventIO pTraceMarkerpTraceMarkerIO pTraceNoColorpTraceIdNoColorpTraceShowNoColorpTraceShowIdNoColorpTraceMNoColorpTraceShowMNoColorpTraceStackNoColorpTraceEventNoColorpTraceEventIONoColorpTraceMarkerNoColorpTraceMarkerIONoColorpTraceIONoColor text-1.2.3.0Data.Text.Internal.BuilderBuilder,ansi-terminal-0.8.0.4-4zlOvCKnE9eI77dRbIqIB1System.Console.ANSI.Types BoldIntensityResetColorIntensityColorSGRbase Data.StringIsString fromStringghc-prim GHC.TypesIntGHC.BaseNothingJustData.Text.Internal.LazyTextfmap Data.Foldablefold.Data.TraversablesequenceGHC.ShowShowControl.Monad.IO.ClassMonadIOStringshow ApplicativeIO Debug.TracetraceMtrace