-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | pretty printer for data types with a 'Show' instance.
--   
--   Please see README.md.
@package pretty-simple
@version 4.1.4.0

module Text.Pretty.Simple.Internal.Color

-- | 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
--   colorNull.
data ColorOptions
ColorOptions :: Style -> Style -> Style -> Style -> [Style] -> ColorOptions

-- | Color to use for quote characters (") around strings.
[colorQuote] :: ColorOptions -> Style

-- | Color to use for strings.
[colorString] :: ColorOptions -> Style

-- | Color for errors, e.g. unmatched brackets.
[colorError] :: ColorOptions -> Style

-- | Color to use for numbers.
[colorNum] :: ColorOptions -> Style

-- | 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.
[colorRainbowParens] :: ColorOptions -> [Style]

-- | Default color options for use on a dark background.
defaultColorOptionsDarkBg :: ColorOptions

-- | Default color options for use on a light background.
defaultColorOptionsLightBg :: ColorOptions

-- | No styling.
colorNull :: Style

-- | Ways to style terminal output.
data Style
Style :: Maybe (Color, Intensity) -> Bool -> Bool -> Bool -> Style
[styleColor] :: Style -> Maybe (Color, Intensity)
[styleBold] :: Style -> Bool
[styleItalic] :: Style -> Bool
[styleUnderlined] :: Style -> Bool
color :: Intensity -> Color -> Style
colorBold :: Intensity -> Color -> Style
convertStyle :: Style -> AnsiStyle
instance GHC.Classes.Eq Text.Pretty.Simple.Internal.Color.ColorOptions
instance GHC.Classes.Eq Text.Pretty.Simple.Internal.Color.Style
instance GHC.Internal.Generics.Generic Text.Pretty.Simple.Internal.Color.ColorOptions
instance GHC.Internal.Generics.Generic Text.Pretty.Simple.Internal.Color.Style
instance GHC.Internal.Show.Show Text.Pretty.Simple.Internal.Color.ColorOptions
instance GHC.Internal.Show.Show Text.Pretty.Simple.Internal.Color.Style

module Text.Pretty.Simple.Internal.Expr
newtype CommaSeparated a
CommaSeparated :: [a] -> CommaSeparated a
[unCommaSeparated] :: CommaSeparated a -> [a]
data Expr
Brackets :: !CommaSeparated [Expr] -> Expr
Braces :: !CommaSeparated [Expr] -> Expr
Parens :: !CommaSeparated [Expr] -> Expr
StringLit :: !String -> Expr
CharLit :: !String -> Expr

-- | We could store this as a Rational, say, instead of a
--   String. 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.
NumberLit :: !String -> Expr
Other :: !String -> Expr
instance GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Text.Pretty.Simple.Internal.Expr.CommaSeparated a)
instance GHC.Internal.Data.Data.Data Text.Pretty.Simple.Internal.Expr.Expr
instance GHC.Classes.Eq a => GHC.Classes.Eq (Text.Pretty.Simple.Internal.Expr.CommaSeparated a)
instance GHC.Classes.Eq Text.Pretty.Simple.Internal.Expr.Expr
instance GHC.Internal.Generics.Generic (Text.Pretty.Simple.Internal.Expr.CommaSeparated a)
instance GHC.Internal.Generics.Generic Text.Pretty.Simple.Internal.Expr.Expr
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Text.Pretty.Simple.Internal.Expr.CommaSeparated a)
instance GHC.Internal.Show.Show Text.Pretty.Simple.Internal.Expr.Expr

module Text.Pretty.Simple.Internal.ExprParser

-- | testString1 and testString2 are convenient to use in
--   GHCi when playing around with how parsing works.
testString1 :: String

-- | See testString1.
testString2 :: String
expressionParse :: String -> [Expr]
parseExpr :: String -> (Expr, String)

-- | Parse multiple expressions.
--   
--   
--   >>> parseExprs "Just 'a'"
--   ([Other "Just ",CharLit "a"],"")
--   
--   
--   Handle escaped characters correctly
--   
--   
--   >>> parseExprs $ "Foo \"hello \\\"world!\""
--   ([Other "Foo ",StringLit "hello \\\"world!"],"")
--   
--   >>> parseExprs $ "'\\''"
--   ([CharLit "\\'"],"")
--   
parseExprs :: String -> ([Expr], String)
parseCSep :: Char -> String -> ([[Expr]], String)

-- | Parse string literals until a trailing double quote.
--   
--   
--   >>> parseStringLit "foobar\" baz"
--   ("foobar"," baz")
--   
--   
--   Keep literal back slashes:
--   
--   
--   >>> parseStringLit "foobar\\\" baz\" after"
--   ("foobar\\\" baz"," after")
--   
parseStringLit :: String -> (String, String)

-- | Parse character literals until a trailing single quote.
--   
--   
--   >>> parseCharLit "a' foobar"
--   ("a"," foobar")
--   
--   
--   Keep literal back slashes:
--   
--   
--   >>> parseCharLit "\\'' hello"
--   ("\\'"," hello")
--   
parseCharLit :: String -> (String, String)

-- | Parses integers and reals, like 123 and 45.67.
--   
--   To 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")
--   
parseNumberLit :: Char -> String -> (String, String)

-- | This 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 parseOther 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")
--   
parseOther :: String -> (String, String)

module Text.Pretty.Simple.Internal.Printer

-- | 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.
data CheckColorTty

-- | Check if the output Handle is a TTY device. If the output
--   Handle is a TTY device, determine whether to print in color
--   based on outputOptionsColorOptions. If not, then set
--   outputOptionsColorOptions to Nothing so the output does
--   not get colorized.
CheckColorTty :: CheckColorTty

-- | Don't check if the output Handle is a TTY device. Determine
--   whether to colorize the output based solely on the value of
--   outputOptionsColorOptions.
NoCheckColorTty :: CheckColorTty

-- | Control how escaped and non-printable are output for strings.
--   
--   See outputOptionsStringStyle for what the output looks like
--   with each of these options.
data StringOutputStyle

-- | 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.
Literal :: StringOutputStyle

-- | Replace non-printable characters with hexadecimal escape sequences.
EscapeNonPrintable :: StringOutputStyle

-- | Output non-printable characters without modification.
DoNotEscapeNonPrintable :: StringOutputStyle

-- | Data-type wrapping up all the options available when rendering the
--   list of Outputs.
data OutputOptions
OutputOptions :: Int -> Int -> Bool -> Bool -> Int -> Maybe ColorOptions -> StringOutputStyle -> OutputOptions

-- | Number of spaces to use when indenting. It should probably be either 2
--   or 4.
[outputOptionsIndentAmount] :: OutputOptions -> Int

-- | The maximum number of characters to fit on to one line.
[outputOptionsPageWidth] :: OutputOptions -> Int

-- | Use less vertical (and more horizontal) space.
[outputOptionsCompact] :: OutputOptions -> Bool

-- | Group closing parentheses on to a single line.
[outputOptionsCompactParens] :: OutputOptions -> Bool

-- | Indent the whole output by this amount.
[outputOptionsInitialIndent] :: OutputOptions -> Int

-- | If this is Nothing, then don't colorize the output. If this is
--   Just colorOptions, then use colorOptions to
--   colorize the output.
[outputOptionsColorOptions] :: OutputOptions -> Maybe ColorOptions

-- | 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 StringOutputStyle called
--   EscapeNonPrintable.
--   
--   (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.
--   
--   
--   >>> 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 Literal. 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.
[outputOptionsStringStyle] :: OutputOptions -> StringOutputStyle

-- | Default values for OutputOptions when printing to a console
--   with a dark background. outputOptionsIndentAmount is 4, and
--   outputOptionsColorOptions is defaultColorOptionsDarkBg.
defaultOutputOptionsDarkBg :: OutputOptions

-- | Default values for OutputOptions when printing to a console
--   with a light background. outputOptionsIndentAmount is 4, and
--   outputOptionsColorOptions is defaultColorOptionsLightBg.
defaultOutputOptionsLightBg :: OutputOptions

-- | Default values for OutputOptions when printing using using ANSI
--   escape sequences for color. outputOptionsIndentAmount is 4, and
--   outputOptionsColorOptions is Nothing.
defaultOutputOptionsNoColor :: OutputOptions

-- | Given OutputOptions, disable colorful output if the given
--   handle is not connected to a TTY.
hCheckTTY :: MonadIO m => Handle -> OutputOptions -> m OutputOptions

-- | Parse a string, and generate an intermediate representation, suitable
--   for passing to any prettyprinter backend. Used by
--   pString etc.
layoutString :: OutputOptions -> String -> SimpleDocStream Style
layoutStringAbstract :: OutputOptions -> String -> SimpleDocStream Annotation

-- | Slight adjustment of prettyExprs for the outermost level, to
--   avoid indenting everything.
prettyExprs' :: OutputOptions -> [Expr] -> Doc Annotation

-- | Construct a Doc from multiple Exprs.
prettyExprs :: OutputOptions -> [Expr] -> Doc Annotation

-- | Construct a Doc from a single Expr.
prettyExpr :: OutputOptions -> Expr -> Doc Annotation

-- | Determine whether this expression should be displayed on a single
--   line.
isSimple :: Expr -> Bool

-- | Traverse the stream, using a Tape to keep track of the current
--   style.
annotateStyle :: OutputOptions -> SimpleDocStream Annotation -> SimpleDocStream Style

-- | An abstract annotation type, representing the various elements we may
--   want to highlight.
data Annotation
Open :: Annotation
Close :: Annotation
Comma :: Annotation
Quote :: Annotation
String :: Annotation
Num :: Annotation

-- | 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"
--   
escapeNonPrintable :: String -> String

-- | Replace an unprintable character except a newline with a hex escape
--   sequence.
escape :: Char -> ShowS

-- | A bidirectional Turing-machine tape: infinite in both directions, with
--   a head pointing to one element.
data Tape a
Tape :: Stream a -> a -> Stream a -> Tape a

-- | the side of the Tape left of tapeHead
[tapeLeft] :: Tape a -> Stream a

-- | the focused element
[tapeHead] :: Tape a -> a

-- | the side of the Tape right of tapeHead
[tapeRight] :: Tape a -> Stream a

-- | Move the head left
moveL :: Tape a -> Tape a

-- | Move the head right
moveR :: Tape a -> Tape a

-- | An infinite list
data Stream a
(:..) :: a -> Stream a -> Stream a

-- | Analogous to repeat
streamRepeat :: t -> Stream t

-- | Analogous to cycle While the inferred signature here is more
--   general, it would diverge on an empty structure
streamCycle :: NonEmpty a -> Stream a
instance GHC.Classes.Eq Text.Pretty.Simple.Internal.Printer.Annotation
instance GHC.Classes.Eq Text.Pretty.Simple.Internal.Printer.CheckColorTty
instance GHC.Classes.Eq Text.Pretty.Simple.Internal.Printer.OutputOptions
instance GHC.Classes.Eq Text.Pretty.Simple.Internal.Printer.StringOutputStyle
instance GHC.Internal.Generics.Generic Text.Pretty.Simple.Internal.Printer.CheckColorTty
instance GHC.Internal.Generics.Generic Text.Pretty.Simple.Internal.Printer.OutputOptions
instance GHC.Internal.Generics.Generic Text.Pretty.Simple.Internal.Printer.StringOutputStyle
instance GHC.Internal.Show.Show Text.Pretty.Simple.Internal.Printer.Annotation
instance GHC.Internal.Show.Show Text.Pretty.Simple.Internal.Printer.CheckColorTty
instance GHC.Internal.Show.Show Text.Pretty.Simple.Internal.Printer.OutputOptions
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Text.Pretty.Simple.Internal.Printer.Stream a)
instance GHC.Internal.Show.Show Text.Pretty.Simple.Internal.Printer.StringOutputStyle
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Text.Pretty.Simple.Internal.Printer.Tape a)

module Text.Pretty.Simple.Internal

-- | This module contains the functions pPrint, pShow, and
--   pString for pretty-printing any Haskell data type with a
--   Show instance.
--   
--   pPrint is the main go-to function when debugging Haskell code.
--   pShow and pString are slight variations on
--   pPrint.
--   
--   pPrint, pShow, and pString will pretty-print in
--   color using ANSI escape codes. They look good on a console with a dark
--   (black) background. The variations pPrintLightBg,
--   pShowLightBg, and pStringLightBg are for printing in
--   color to a console with a light (white) background. The variations
--   pPrintNoColor, pShowNoColor, and pStringNoColor
--   are for pretty-printing without using color.
--   
--   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.
--   
--   The variations pPrintOpt, pShowOpt, and
--   pStringOpt are used when specifying the OutputOptions.
--   Most users can ignore these.
--   
--   There are a few other functions available that are similar to
--   pPrint.
--   
--   See the Examples section at the end of this module for examples of
--   acutally using pPrint. See the README.md for examples of
--   printing in color.
module Text.Pretty.Simple

-- | Pretty-print any data type that has a Show instance.
--   
--   If you've never seen MonadIO 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.
--   
--   This function is for printing to a dark background. Use
--   pPrintLightBg for printing to a terminal with a light
--   background. Different colors are used.
--   
--   Prints to stdout. Use pHPrint to print to a different
--   Handle.
--   
--   
--   >>> pPrint [Just (1, "hello")]
--   [ Just
--       ( 1
--       , "hello"
--       )
--   ]
--   
pPrint :: (MonadIO m, Show a) => a -> m ()

-- | Similar to pPrint, but take a Handle to print to.
--   
--   
--   >>> pHPrint stdout [Just (1, "hello")]
--   [ Just
--       ( 1
--       , "hello"
--       )
--   ]
--   
pHPrint :: (MonadIO m, Show a) => Handle -> a -> m ()

-- | Similar to pPrint, but the first argument is a String
--   representing a data type that has already been showed.
--   
--   
--   >>> pPrintString $ show [ Just (1, "hello"), Nothing ]
--   [ Just
--       ( 1
--       , "hello"
--       )
--   , Nothing
--   ]
--   
pPrintString :: MonadIO m => String -> m ()

-- | Similar to pHPrintString, but take a Handle to print to.
--   
--   
--   >>> pHPrintString stdout $ show [ Just (1, "hello"), Nothing ]
--   [ Just
--       ( 1
--       , "hello"
--       )
--   , Nothing
--   ]
--   
pHPrintString :: MonadIO m => Handle -> String -> m ()

-- | Similar to pPrint, but print in color regardless of whether the
--   output goes to a TTY or not.
--   
--   See pPrint for an example of how to use this function.
pPrintForceColor :: (MonadIO m, Show a) => a -> m ()

-- | Similar to pPrintForceColor, but take a Handle to print
--   to.
--   
--   See pHPrint for an example of how to use this function.
pHPrintForceColor :: (MonadIO m, Show a) => Handle -> a -> m ()

-- | Similar to pPrintString, but print in color regardless of
--   whether the output goes to a TTY or not.
--   
--   See pPrintString for an example of how to use this function.
pPrintStringForceColor :: MonadIO m => String -> m ()

-- | Similar to pHPrintString, but print in color regardless of
--   whether the output goes to a TTY or not.
--   
--   See pHPrintString for an example of how to use this function.
pHPrintStringForceColor :: MonadIO m => Handle -> String -> m ()

-- | Similar to pPrintForceColor, but just return the resulting
--   pretty-printed data type as a Text instead of printing it to
--   the screen.
--   
--   This function is for printing to a dark background.
--   
--   See pShowNoColor for an example of how to use this function.
pShow :: Show a => a -> Text

-- | 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.
pString :: String -> Text

-- | Alias for pPrint.
pPrintDarkBg :: (MonadIO m, Show a) => a -> m ()

-- | Alias for pHPrint.
pHPrintDarkBg :: (MonadIO m, Show a) => Handle -> a -> m ()

-- | Alias for pPrintString.
pPrintStringDarkBg :: MonadIO m => String -> m ()

-- | Alias for pHPrintString.
pHPrintStringDarkBg :: MonadIO m => Handle -> String -> m ()

-- | Alias for pPrintForceColor.
pPrintForceColorDarkBg :: (MonadIO m, Show a) => a -> m ()

-- | Alias for pHPrintForceColor.
pHPrintForceColorDarkBg :: (MonadIO m, Show a) => Handle -> a -> m ()

-- | Alias for pPrintStringForceColor.
pPrintStringForceColorDarkBg :: MonadIO m => String -> m ()

-- | Alias for pHPrintStringForceColor.
pHPrintStringForceColorDarkBg :: MonadIO m => Handle -> String -> m ()

-- | Alias for pShow.
pShowDarkBg :: Show a => a -> Text

-- | Alias for pString.
pStringDarkBg :: String -> Text

-- | Just like pPrintDarkBg, but for printing to a light background.
pPrintLightBg :: (MonadIO m, Show a) => a -> m ()

-- | Just like pHPrintDarkBg, but for printing to a light
--   background.
pHPrintLightBg :: (MonadIO m, Show a) => Handle -> a -> m ()

-- | Just like pPrintStringDarkBg, but for printing to a light
--   background.
pPrintStringLightBg :: MonadIO m => String -> m ()

-- | Just like pHPrintStringDarkBg, but for printing to a light
--   background.
pHPrintStringLightBg :: MonadIO m => Handle -> String -> m ()

-- | Just like pPrintForceColorDarkBg, but for printing to a light
--   background.
pPrintForceColorLightBg :: (MonadIO m, Show a) => a -> m ()

-- | Just like pHPrintForceColorDarkBg, but for printing to a light
--   background.
pHPrintForceColorLightBg :: (MonadIO m, Show a) => Handle -> a -> m ()

-- | Just like pPrintStringForceColorDarkBg, but for printing to a
--   light background.
pPrintStringForceColorLightBg :: MonadIO m => String -> m ()

-- | Just like pHPrintStringForceColorDarkBg, but for printing to a
--   light background.
pHPrintStringForceColorLightBg :: MonadIO m => Handle -> String -> m ()

-- | Just like pShowDarkBg, but for printing to a light background.
pShowLightBg :: Show a => a -> Text

-- | Just like pStringDarkBg, but for printing to a light
--   background.
pStringLightBg :: String -> Text

-- | Similar to pPrint, but doesn't print in color. However, data
--   types will still be indented nicely.
--   
--   
--   >>> pPrintNoColor $ Just ["hello", "bye"]
--   Just
--       [ "hello"
--       , "bye"
--       ]
--   
pPrintNoColor :: (MonadIO m, Show a) => a -> m ()

-- | Like pPrintNoColor, but take a Handle to determine where
--   to print to.
--   
--   
--   >>> pHPrintNoColor stdout $ Just ["hello", "bye"]
--   Just
--       [ "hello"
--       , "bye"
--       ]
--   
pHPrintNoColor :: (MonadIO m, Show a) => Handle -> a -> m ()

-- | Similar to pPrintString, but doesn't print in color. However,
--   data types will still be indented nicely.
--   
--   
--   >>> pPrintStringNoColor $ show $ Just ["hello", "bye"]
--   Just
--       [ "hello"
--       , "bye"
--       ]
--   
pPrintStringNoColor :: MonadIO m => String -> m ()

-- | Like pPrintStringNoColor, but take a Handle to determine
--   where to print to.
--   
--   
--   >>> pHPrintStringNoColor stdout $ show $ Just ["hello", "bye"]
--   Just
--       [ "hello"
--       , "bye"
--       ]
--   
pHPrintStringNoColor :: MonadIO m => Handle -> String -> m ()

-- | Like pShow, but without color.
--   
--   
--   >>> pShowNoColor [ Nothing, Just (1, "hello") ]
--   "[ Nothing\n, Just\n    ( 1\n    , \"hello\"\n    )\n]"
--   
pShowNoColor :: Show a => a -> Text

-- | LIke pString, but without color.
--   
--   
--   >>> pStringNoColor $ show [1, 2, 3]
--   "[ 1\n, 2\n, 3\n]"
--   
pStringNoColor :: String -> Text

-- | Similar to pPrint but takes OutputOptions to change how
--   the pretty-printing is done.
--   
--   For example, pPrintOpt 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 indented
--   
--   
--   >>> pPrintOpt NoCheckColorTty defaultOutputOptionsNoColor (1, (2, "foo\nbar\nbaz", 3))
--   ( 1
--   ,
--       ( 2
--       , "foo
--         bar
--         baz"
--       , 3
--       )
--   )
--   
--   
--   Lines get indented even in custom show instances
--   
--   
--   >>> data Foo = Foo
--   
--   >>> instance Show Foo where show _ = "foo\nbar\nbaz"
--   
--   >>> pPrintOpt CheckColorTty defaultOutputOptionsNoColor (1, (2, Foo, 3))
--   ( 1
--   ,
--       ( 2
--       , foo
--         bar
--         baz
--       , 3
--       )
--   )
--   
--   
--   CheckColorTty determines whether to test stdout for
--   whether or not it is connected to a TTY.
--   
--   If set to NoCheckColorTty, then pPrintOpt won't check if
--   stdout is a TTY. It will print in color depending on the value
--   of outputOptionsColorOptions.
--   
--   If set to CheckColorTty, then pPrintOpt will check if
--   stdout is conneted to a TTY. If stdout is determined to
--   be connected to a TTY, then it will print in color depending on the
--   value of outputOptionsColorOptions. If stdout is
--   determined to NOT be connected to a TTY, then it will NOT print in
--   color, regardless of the value of outputOptionsColorOptions.
pPrintOpt :: (MonadIO m, Show a) => CheckColorTty -> OutputOptions -> a -> m ()

-- | Similar to pPrintOpt, but take a Handle to determine
--   where to print to.
pHPrintOpt :: (MonadIO m, Show a) => CheckColorTty -> OutputOptions -> Handle -> a -> m ()

-- | Similar to pPrintOpt, but the last argument is a string
--   representing a data structure that has already been showed.
--   
--   
--   >>> let foo = show (1, (2, "hello", 3))
--   
--   >>> pPrintStringOpt CheckColorTty defaultOutputOptionsNoColor foo
--   ( 1
--   ,
--       ( 2
--       , "hello"
--       , 3
--       )
--   )
--   
pPrintStringOpt :: MonadIO m => CheckColorTty -> OutputOptions -> String -> m ()

-- | Similar to pPrintStringOpt, but take a Handle to
--   determine where to print to.
--   
--   
--   >>> let foo = show (1, (2, "hello", 3))
--   
--   >>> pHPrintStringOpt CheckColorTty defaultOutputOptionsNoColor stdout foo
--   ( 1
--   ,
--       ( 2
--       , "hello"
--       , 3
--       )
--   )
--   
pHPrintStringOpt :: MonadIO m => CheckColorTty -> OutputOptions -> Handle -> String -> m ()

-- | Like pShow but takes OutputOptions to change how the
--   pretty-printing is done.
pShowOpt :: Show a => OutputOptions -> a -> Text

-- | Like pString but takes OutputOptions to change how the
--   pretty-printing is done.
pStringOpt :: OutputOptions -> String -> Text

-- | Data-type wrapping up all the options available when rendering the
--   list of Outputs.
data OutputOptions
OutputOptions :: Int -> Int -> Bool -> Bool -> Int -> Maybe ColorOptions -> StringOutputStyle -> OutputOptions

-- | Number of spaces to use when indenting. It should probably be either 2
--   or 4.
[outputOptionsIndentAmount] :: OutputOptions -> Int

-- | The maximum number of characters to fit on to one line.
[outputOptionsPageWidth] :: OutputOptions -> Int

-- | Use less vertical (and more horizontal) space.
[outputOptionsCompact] :: OutputOptions -> Bool

-- | Group closing parentheses on to a single line.
[outputOptionsCompactParens] :: OutputOptions -> Bool

-- | Indent the whole output by this amount.
[outputOptionsInitialIndent] :: OutputOptions -> Int

-- | If this is Nothing, then don't colorize the output. If this is
--   Just colorOptions, then use colorOptions to
--   colorize the output.
[outputOptionsColorOptions] :: OutputOptions -> Maybe ColorOptions

-- | 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 StringOutputStyle called
--   EscapeNonPrintable.
--   
--   (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.
--   
--   
--   >>> 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 Literal. 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.
[outputOptionsStringStyle] :: OutputOptions -> StringOutputStyle

-- | Control how escaped and non-printable are output for strings.
--   
--   See outputOptionsStringStyle for what the output looks like
--   with each of these options.
data StringOutputStyle

-- | 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.
Literal :: StringOutputStyle

-- | Replace non-printable characters with hexadecimal escape sequences.
EscapeNonPrintable :: StringOutputStyle

-- | Output non-printable characters without modification.
DoNotEscapeNonPrintable :: StringOutputStyle

-- | Default values for OutputOptions when printing to a console
--   with a dark background. outputOptionsIndentAmount is 4, and
--   outputOptionsColorOptions is defaultColorOptionsDarkBg.
defaultOutputOptionsDarkBg :: OutputOptions

-- | Default values for OutputOptions when printing to a console
--   with a light background. outputOptionsIndentAmount is 4, and
--   outputOptionsColorOptions is defaultColorOptionsLightBg.
defaultOutputOptionsLightBg :: OutputOptions

-- | Default values for OutputOptions when printing using using ANSI
--   escape sequences for color. outputOptionsIndentAmount is 4, and
--   outputOptionsColorOptions is Nothing.
defaultOutputOptionsNoColor :: OutputOptions

-- | 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.
data CheckColorTty

-- | Check if the output Handle is a TTY device. If the output
--   Handle is a TTY device, determine whether to print in color
--   based on outputOptionsColorOptions. If not, then set
--   outputOptionsColorOptions to Nothing so the output does
--   not get colorized.
CheckColorTty :: CheckColorTty

-- | Don't check if the output Handle is a TTY device. Determine
--   whether to colorize the output based solely on the value of
--   outputOptionsColorOptions.
NoCheckColorTty :: CheckColorTty

-- | Default color options for use on a dark background.
defaultColorOptionsDarkBg :: ColorOptions

-- | Default color options for use on a light background.
defaultColorOptionsLightBg :: ColorOptions

-- | 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
--   colorNull.
data ColorOptions
ColorOptions :: Style -> Style -> Style -> Style -> [Style] -> ColorOptions

-- | Color to use for quote characters (") around strings.
[colorQuote] :: ColorOptions -> Style

-- | Color to use for strings.
[colorString] :: ColorOptions -> Style

-- | Color for errors, e.g. unmatched brackets.
[colorError] :: ColorOptions -> Style

-- | Color to use for numbers.
[colorNum] :: ColorOptions -> Style

-- | 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.
[colorRainbowParens] :: ColorOptions -> [Style]

-- | Ways to style terminal output.
data Style
Style :: Maybe (Color, Intensity) -> Bool -> Bool -> Bool -> Style
[styleColor] :: Style -> Maybe (Color, Intensity)
[styleBold] :: Style -> Bool
[styleItalic] :: Style -> Bool
[styleUnderlined] :: Style -> Bool

-- | The 8 ANSI terminal colors.
data Color
Black :: Color
Red :: Color
Green :: Color
Yellow :: Color
Blue :: Color
Magenta :: Color
Cyan :: Color
White :: Color

-- | Dull or vivid coloring, as supported by ANSI terminals.
data Intensity
Vivid :: Intensity
Dull :: Intensity

-- | No styling.
colorNull :: Style

-- | This module contains the same functionality with Prelude's
--   Debug.Trace module, with pretty printing the debug strings.
--   
--   Warning: This module also shares the same unsafety of
--   Debug.Trace module.
module Debug.Pretty.Simple

-- | The pTrace 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 pTrace 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.

-- | Warning: pTrace remains in code
pTrace :: String -> a -> a

-- | Like pTrace but returns the message instead of a third value.

-- | Warning: pTraceId remains in code
pTraceId :: String -> String

-- | Like pTrace, but uses show on the argument to convert it
--   to a String.
--   
--   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 = ...
--       ...
--   

-- | Warning: pTraceShow remains in code
pTraceShow :: Show a => a -> b -> b

-- | Like pTraceShow but returns the shown value instead of a third
--   value.

-- | Warning: pTraceShowId remains in code
pTraceShowId :: Show a => a -> a

-- | The pTraceIO function outputs the trace message from the IO
--   monad. This sequences the output with respect to other IO actions.

-- | Warning: pTraceIO remains in code
pTraceIO :: String -> IO ()

-- | Like pTrace but returning unit in an arbitrary
--   Applicative context. Allows for convenient use in do-notation.
--   
--   Note that the application of pTraceM is not an action in the
--   Applicative context, as pTraceIO is in the IO
--   type. While the fresh bindings in the following example will force the
--   traceM 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
--   

-- | Warning: pTraceM remains in code
pTraceM :: Applicative f => String -> f ()

-- | Like pTraceM, but uses show on the argument to convert
--   it to a String.
--   
--   
--   ... = do
--     x <- ...
--     pTraceShowM $ x
--     y <- ...
--     pTraceShowM $ x + y
--   

-- | Warning: pTraceShowM remains in code
pTraceShowM :: (Show a, Applicative f) => a -> f ()

-- | like pTrace, 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
--   pTraceStack behaves exactly like pTrace. 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.

-- | Warning: pTraceStack remains in code
pTraceStack :: String -> a -> a

-- | The pTraceEvent function behaves like trace 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
--   pTraceEventIO 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 pTraceEvent.

-- | Warning: pTraceEvent remains in code
pTraceEvent :: String -> a -> a

-- | The pTraceEventIO function emits a message to the eventlog, if
--   eventlog profiling is available and enabled at runtime.
--   
--   Compared to pTraceEvent, pTraceEventIO sequences the
--   event with respect to other IO actions.

-- | Warning: pTraceEventIO remains in code
pTraceEventIO :: String -> IO ()

-- | The pTraceMarker 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
--   pTraceMarkerIO 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 pTraceMarker.

-- | Warning: pTraceMarker remains in code
pTraceMarker :: String -> a -> a

-- | The pTraceMarkerIO function emits a marker to the eventlog, if
--   eventlog profiling is available and enabled at runtime.
--   
--   Compared to pTraceMarker, pTraceMarkerIO sequences the
--   event with respect to other IO actions.

-- | Warning: pTraceMarkerIO remains in code
pTraceMarkerIO :: String -> IO ()

-- | The pTraceWith function pretty prints the result of applying
--   f to a and returns back @a
--   
--   @since ?

-- | Warning: pTraceWith remains in code
pTraceWith :: (a -> String) -> a -> a

-- | The pTraceShowWith function similar to pTraceWith except
--   that @f can return any type that implements Show
--   
--   @since ?

-- | Warning: pTraceShowWith remains in code
pTraceShowWith :: Show b => (a -> b) -> a -> a

-- | Similar to pTrace, but forcing color.

-- | Warning: pTraceForceColor remains in code
pTraceForceColor :: String -> a -> a

-- | Similar to pTraceId, but forcing color.

-- | Warning: pTraceIdForceColor remains in code
pTraceIdForceColor :: String -> String

-- | Similar to pTraceShow, but forcing color.

-- | Warning: pTraceShowForceColor remains in code
pTraceShowForceColor :: Show a => a -> b -> b

-- | Similar to pTraceShowId, but forcing color.

-- | Warning: pTraceShowIdForceColor remains in code
pTraceShowIdForceColor :: Show a => a -> a

-- | Similar to pTraceM, but forcing color.

-- | Warning: pTraceMForceColor remains in code
pTraceMForceColor :: Applicative f => String -> f ()

-- | Similar to pTraceShowM, but forcing color.

-- | Warning: pTraceShowMForceColor remains in code
pTraceShowMForceColor :: (Show a, Applicative f) => a -> f ()

-- | Similar to pTraceStack, but forcing color.

-- | Warning: pTraceStackForceColor remains in code
pTraceStackForceColor :: String -> a -> a

-- | Similar to pTraceEvent, but forcing color.

-- | Warning: pTraceEventForceColor remains in code
pTraceEventForceColor :: String -> a -> a

-- | Similar to pTraceEventIO, but forcing color.

-- | Warning: pTraceEventIOForceColor remains in code
pTraceEventIOForceColor :: String -> IO ()

-- | Similar to pTraceMarker, but forcing color.

-- | Warning: pTraceMarkerForceColor remains in code
pTraceMarkerForceColor :: String -> a -> a

-- | Similar to pTraceMarkerIO, but forcing color.

-- | Warning: pTraceMarkerIOForceColor remains in code
pTraceMarkerIOForceColor :: String -> IO ()

-- | Similar to pTraceIO, but forcing color.

-- | Warning: pTraceIOForceColor remains in code
pTraceIOForceColor :: String -> IO ()

-- | Similar to pTrace, but without color.
--   
--   
--   >>> pTraceNoColor "wow" ()
--   wow
--   ()
--   

-- | Warning: pTraceNoColor remains in code
pTraceNoColor :: String -> a -> a

-- | Similar to pTraceId, but without color.
--   
--   
--   >>> pTraceIdNoColor "(1, 2, 3)" `seq` ()
--   ( 1
--   , 2
--   , 3
--   )
--   ()
--   

-- | Warning: pTraceIdNoColor remains in code
pTraceIdNoColor :: String -> String

-- | Similar to pTraceShow, but without color.
--   
--   
--   >>> import qualified Data.Map as M
--   
--   >>> pTraceShowNoColor (M.fromList [(1, True)]) ()
--   fromList
--       [
--           ( 1
--           , True
--           )
--       ]
--   ()
--   

-- | Warning: pTraceShowNoColor remains in code
pTraceShowNoColor :: Show a => a -> b -> b

-- | Similar to pTraceShowId, but without color.
--   
--   
--   >>> import qualified Data.Map as M
--   
--   >>> pTraceShowIdNoColor (M.fromList [(1, True)]) `seq` ()
--   fromList
--       [
--           ( 1
--           , True
--           )
--       ]
--   ()
--   

-- | Warning: pTraceShowIdNoColor remains in code
pTraceShowIdNoColor :: Show a => a -> a

-- | Similar to pTraceM, but without color.
--   
--   
--   >>> pTraceMNoColor "wow"
--   wow
--   

-- | Warning: pTraceMNoColor remains in code
pTraceMNoColor :: Applicative f => String -> f ()

-- | Similar to pTraceShowM, but without color.
--   
--   
--   >>> pTraceShowMNoColor [1,2,3]
--   [ 1
--   , 2
--   , 3
--   ]
--   

-- | Warning: pTraceShowMNoColor remains in code
pTraceShowMNoColor :: (Show a, Applicative f) => a -> f ()

-- | Similar to pTraceStack, but without color.
--   
--   
--   >>> pTraceStackNoColor "wow" () `seq` ()
--   wow
--   ()
--   

-- | Warning: pTraceStackNoColor remains in code
pTraceStackNoColor :: String -> a -> a

-- | Similar to pTraceEvent, but without color.

-- | Warning: pTraceEventNoColor remains in code
pTraceEventNoColor :: String -> a -> a

-- | Similar to pTraceEventIO, but without color.

-- | Warning: pTraceEventIONoColor remains in code
pTraceEventIONoColor :: String -> IO ()

-- | Similar to pTraceMarker, but without color.

-- | Warning: pTraceMarkerNoColor remains in code
pTraceMarkerNoColor :: String -> a -> a

-- | Similar to pTraceMarkerIO, but without color.

-- | Warning: pTraceMarkerIONoColor remains in code
pTraceMarkerIONoColor :: String -> IO ()

-- | Similar to pTraceIO, but without color.
--   
--   
--   >>> pTraceIONoColor "(1, 2, 3)"
--   ( 1
--   , 2
--   , 3
--   )
--   

-- | Warning: pTraceIONoColor remains in code
pTraceIONoColor :: String -> IO ()

-- | Like pTrace but takes OutputOptions.

-- | Warning: pTraceOpt remains in code
pTraceOpt :: CheckColorTty -> OutputOptions -> String -> a -> a

-- | Like pTraceId but takes OutputOptions.

-- | Warning: pTraceIdOpt remains in code
pTraceIdOpt :: CheckColorTty -> OutputOptions -> String -> String

-- | Like pTraceShow but takes OutputOptions.

-- | Warning: pTraceShowOpt remains in code
pTraceShowOpt :: Show a => CheckColorTty -> OutputOptions -> a -> b -> b

-- | Like pTraceShowId but takes OutputOptions.

-- | Warning: pTraceShowIdOpt remains in code
pTraceShowIdOpt :: Show a => CheckColorTty -> OutputOptions -> a -> a

-- | Like pTraceIO but takes OutputOptions.

-- | Warning: pTraceOptIO remains in code
pTraceOptIO :: CheckColorTty -> OutputOptions -> String -> IO ()

-- | Like pTraceM but takes OutputOptions.

-- | Warning: pTraceOptM remains in code
pTraceOptM :: Applicative f => CheckColorTty -> OutputOptions -> String -> f ()

-- | Like pTraceShowM but takes OutputOptions.

-- | Warning: pTraceShowOptM remains in code
pTraceShowOptM :: (Show a, Applicative f) => CheckColorTty -> OutputOptions -> a -> f ()

-- | Like pTraceStack but takes OutputOptions.

-- | Warning: pTraceStackOpt remains in code
pTraceStackOpt :: CheckColorTty -> OutputOptions -> String -> a -> a

-- | Like pTraceEvent but takes OutputOptions.

-- | Warning: pTraceEventOpt remains in code
pTraceEventOpt :: CheckColorTty -> OutputOptions -> String -> a -> a

-- | Like pTraceEventIO but takes OutputOptions.

-- | Warning: pTraceEventOptIO remains in code
pTraceEventOptIO :: CheckColorTty -> OutputOptions -> String -> IO ()

-- | Like pTraceMarker but takes OutputOptions.

-- | Warning: pTraceMarkerOpt remains in code
pTraceMarkerOpt :: CheckColorTty -> OutputOptions -> String -> a -> a

-- | Like pTraceMarkerIO but takes OutputOptions.

-- | Warning: pTraceMarkerOptIO remains in code
pTraceMarkerOptIO :: CheckColorTty -> OutputOptions -> String -> IO ()
