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

-- | Pretty-printing for RIO
--   
--   Combine RIO's log capabilities with pretty printing
@package rio-prettyprint
@version 0.1.8.0

-- | For the most part, the data constructors of Style do not clash
--   with other names. When they do, import the module qualified. For
--   example:
--   
--   
--   import qualified RIO.PrettyPrint.Types.PrettyPrint as PP
--   
module RIO.PrettyPrint.Types

-- | Type representing styles of output.
data Style

-- | Intended to be used sparingly, not to style entire long messages. For
--   example, to style the Error: or [error] label for an
--   error message, not the entire message.
Error :: Style

-- | Intended to be used sparingly, not to style entire long messages. For
--   example, to style the Warning: or [warn] label for a
--   warning message, not the entire message.
Warning :: Style

-- | Intended to be used sparingly, not to style entire long messages. For
--   example, to style the [info] label for an info message, not
--   the entire message.
Info :: Style

-- | Intended to be used sparingly, not to style entire long messages. For
--   example, to style the [debug] label for a debug message, not
--   the entire message.
Debug :: Style

-- | Intended to be used sparingly, not to style entire long messages. For
--   example, to style the [...] label for an other log level
--   message, not the entire message.
OtherLevel :: Style

-- | Style in a way to emphasize that it is a particularly good thing.
Good :: Style

-- | Style as a shell command, i.e. when suggesting something to the user
--   that should be typed in directly as written.
Shell :: Style

-- | Style as a filename. See Dir for directories.
File :: Style

-- | Style as a URL.
Url :: Style

-- | Style as a directory name. See File for files.
Dir :: Style

-- | Style used to highlight part of a recommended course of action.
Recommendation :: Style

-- | Style in a way that emphasizes that it is related to a current thing.
--   For example, to report the current package that is being processed
--   when outputting the name of it.
Current :: Style

-- | Style used the highlight the target of a course of action.
Target :: Style

-- | Style as a module name.
Module :: Style

-- | Style used to highlight the named component of a package.
PkgComponent :: Style

-- | Style for secondary content. For example, to style timestamps.
Secondary :: Style

-- | Intended to be used sparingly, not to style entire long messages. For
--   example, to style the duration in a Finished process in ...
--   ms message.
Highlight :: Style

-- | Style specifications indexed by the style.
type Styles = Array Style StyleSpec

-- | A style specification, pairing its 'key' with the corresponding list
--   of SGR codes.
type StyleSpec = (Text, [SGR])
instance GHC.Internal.Enum.Bounded RIO.PrettyPrint.Types.Style
instance GHC.Internal.Enum.Enum RIO.PrettyPrint.Types.Style
instance GHC.Classes.Eq RIO.PrettyPrint.Types.Style
instance GHC.Internal.Ix.Ix RIO.PrettyPrint.Types.Style
instance GHC.Classes.Ord RIO.PrettyPrint.Types.Style
instance GHC.Internal.Base.Semigroup RIO.PrettyPrint.Types.Style
instance GHC.Internal.Show.Show RIO.PrettyPrint.Types.Style

module RIO.PrettyPrint.DefaultStyles

-- | Default styles for rio-prettyprint output.
defaultStyles :: Styles

module RIO.PrettyPrint.StylesUpdate

-- | Updates to Styles
newtype StylesUpdate
StylesUpdate :: [(Style, StyleSpec)] -> StylesUpdate
[stylesUpdate] :: StylesUpdate -> [(Style, StyleSpec)]

-- | Parse a string that is a colon-delimited sequence of key=value, where
--   key is a style name and value is a
--   semicolon-delimited list of ANSI SGR (Select Graphic
--   Rendition) control codes (in decimal). Keys that are not present in
--   defaultStyles are ignored. Items in the semicolon-delimited
--   list that are not recognised as valid control codes are ignored.
parseStylesUpdateFromString :: String -> StylesUpdate

-- | Environment values with a styles update.
class HasStylesUpdate env
stylesUpdateL :: HasStylesUpdate env => Lens' env StylesUpdate
instance GHC.Classes.Eq RIO.PrettyPrint.StylesUpdate.StylesUpdate
instance Data.Aeson.Types.FromJSON.FromJSON RIO.PrettyPrint.StylesUpdate.StylesUpdate
instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate RIO.PrettyPrint.StylesUpdate.StylesUpdate
instance GHC.Internal.Base.Monoid RIO.PrettyPrint.StylesUpdate.StylesUpdate
instance GHC.Internal.Base.Semigroup RIO.PrettyPrint.StylesUpdate.StylesUpdate
instance GHC.Internal.Show.Show RIO.PrettyPrint.StylesUpdate.StylesUpdate

-- | This module is based, in part, on some of the interface for
--   Text.PrettyPrint.Annotated.Leijen.
module Text.PrettyPrint.Leijen.Extended
class Pretty a
pretty :: Pretty a => a -> StyleDoc
($dmpretty) :: (Pretty a, Show a) => a -> StyleDoc

-- | A document annotated by a style.
newtype StyleDoc
StyleDoc :: Doc StyleAnn -> StyleDoc
[unStyleDoc] :: StyleDoc -> Doc StyleAnn

-- | A style annotation.
newtype StyleAnn
StyleAnn :: Maybe Style -> StyleAnn
displayAnsi :: (Pretty a, HasLogFunc env, HasStylesUpdate env, MonadReader env m, HasCallStack) => Int -> a -> m Utf8Builder
displayPlain :: (Pretty a, HasLogFunc env, HasStylesUpdate env, MonadReader env m, HasCallStack) => Int -> a -> m Utf8Builder
renderDefault :: Int -> Doc a -> SimpleDoc a

-- | The document (nest i x) renders document x with the
--   current indentation level increased by i (See also hang,
--   align and indent).
--   
--   
--      nest 2 (fromString "hello" <> line <> fromString "world")
--   <> line
--   <> fromString "!"
--   
--   
--   outputs as:
--   
--   
--   hello
--     world
--   !
--   
nest :: Int -> StyleDoc -> StyleDoc

-- | The line document advances to the next line and indents to
--   the current nesting level. Document line behaves like
--   (fromString " ") if the line break is undone by group.
line :: StyleDoc

-- | The linebreak document advances to the next line and indents
--   to the current nesting level. Document linebreak behaves like
--   mempty if the line break is undone by group.
linebreak :: StyleDoc

-- | The group combinator is used to specify alternative layouts.
--   The document (group x) undoes all line breaks in document
--   x. The resulting line is added to the current line if that
--   fits the page. Otherwise, the document x is rendered without
--   any changes.
group :: StyleDoc -> StyleDoc

-- | The document softline behaves like (fromString " ")
--   if the resulting output fits the page, otherwise it behaves like
--   line.
--   
--   
--   softline = group line
--   
softline :: StyleDoc

-- | The document softbreak behaves like mempty if the
--   resulting output fits the page, otherwise it behaves like line.
--   
--   
--   softbreak = group linebreak
--   
softbreak :: StyleDoc

-- | The document (align x) renders document x with the
--   nesting level set to the current column. It is used for example to
--   implement hang.
--   
--   As an example, we will put a document right above another one,
--   regardless of the current nesting level:
--   
--   
--   x $$ y = align (x <> line <> y)
--   
--   
--   
--   test = fromString "hi" <+> (fromString "nice" $$ fromString "world")
--   
--   
--   which will be layed out as:
--   
--   
--   hi nice
--      world
--   
align :: StyleDoc -> StyleDoc

-- | The hang combinator implements hanging indentation. The document
--   (hang i x) renders document x with a nesting level
--   set to the current column plus i. The following example uses
--   hanging indentation for some text:
--   
--   
--   test = hang 4 (fillSep (map fromString
--          (words "the hang combinator indents these words !")))
--   
--   
--   Which lays out on a page with a width of 20 characters as:
--   
--   
--   the hang combinator
--       indents these
--       words !
--   
--   
--   The hang combinator is implemented as:
--   
--   
--   hang i x = align (nest i x)
--   
hang :: Int -> StyleDoc -> StyleDoc

-- | The document (indent i x) indents document x with
--   i spaces.
--   
--   
--   test = indent 4 (fillSep (map fromString
--          (words "the indent combinator indents these words !")))
--   
--   
--   Which lays out with a page width of 20 as:
--   
--   
--   the indent
--   combinator
--   indents these
--   words !
--   
indent :: Int -> StyleDoc -> StyleDoc

-- | The document (encloseSep l r sep xs) concatenates the
--   documents xs separated by sep and encloses the
--   resulting document by l and r. The documents are
--   rendered horizontally if that fits the page. Otherwise they are
--   aligned vertically. All separators are put in front of the elements.
--   For example, the combinator list can be defined with
--   encloseSep:
--   
--   
--   list xs = encloseSep lbracket rbracket comma xs
--   test = fromString "list" <+> (list (map int [10, 200, 3000]))
--   
--   
--   Which is layed out with a page width of 20 as:
--   
--   
--   list [10,200,3000]
--   
--   
--   But when the page width is 15, it is layed out as:
--   
--   
--   list [10
--        ,200
--        ,3000]
--   
encloseSep :: StyleDoc -> StyleDoc -> StyleDoc -> [StyleDoc] -> StyleDoc

-- | The document (x <+> y) concatenates document x
--   and y with a (fromString " ") in between. (infixr 6)
(<+>) :: StyleDoc -> StyleDoc -> StyleDoc

-- | The document (hsep xs) concatenates all documents xs
--   horizontally with (<+>).
hsep :: [StyleDoc] -> StyleDoc

-- | The document (vsep xs) concatenates all documents xs
--   vertically with (<> line <>). If a group
--   undoes the line breaks inserted by vsep, all documents are
--   separated with a space.
--   
--   
--   someText = map fromString (words ("text to lay out"))
--   
--   test = fromString "some" <+> vsep someText
--   
--   
--   This is layed out as:
--   
--   
--   some text
--   to
--   lay
--   out
--   
--   
--   The align combinator can be used to align the documents under
--   their first element
--   
--   
--   test = fromString "some" <+> align (vsep someText)
--   
--   
--   Which is printed as:
--   
--   
--   some text
--        to
--        lay
--        out
--   
vsep :: [StyleDoc] -> StyleDoc

-- | The document (fillSep xs) concatenates documents xs
--   horizontally with (<+>) as long as its fits the
--   page, than inserts a line and continues doing that for all
--   documents in xs.
--   
--   
--   fillSep xs = foldr (<> softline <>) mempty xs
--   
fillSep :: [StyleDoc] -> StyleDoc

-- | The document (sep xs) concatenates all documents xs
--   either horizontally with (<+>), if it fits the page, or
--   vertically with (<> line <>).
--   
--   
--   sep xs = group (vsep xs)
--   
sep :: [StyleDoc] -> StyleDoc

-- | The document (hcat xs) concatenates all documents xs
--   horizontally with (<>).
hcat :: [StyleDoc] -> StyleDoc

-- | The document (vcat xs) concatenates all documents xs
--   vertically with (<> linebreak <>). If a
--   group undoes the line breaks inserted by vcat, all
--   documents are directly concatenated.
vcat :: [StyleDoc] -> StyleDoc

-- | The document (fillCat xs) concatenates documents xs
--   horizontally with (<>) as long as its fits the page,
--   than inserts a linebreak and continues doing that for all
--   documents in xs.
--   
--   
--   fillCat xs = foldr (<> softbreak <>) mempty xs
--   
fillCat :: [StyleDoc] -> StyleDoc

-- | The document (cat xs) concatenates all documents xs
--   either horizontally with (<>), if it fits the page, or
--   vertically with (<> linebreak <>).
--   
--   
--   cat xs = group (vcat xs)
--   
cat :: [StyleDoc] -> StyleDoc

-- | (punctuate p xs) concatenates all documents in xs
--   with document p except for the last document.
--   
--   
--   someText = map fromString ["words", "in", "a", "tuple"]
--   test = parens (align (cat (punctuate comma someText)))
--   
--   
--   This is layed out on a page width of 20 as:
--   
--   
--   (words,in,a,tuple)
--   
--   
--   But when the page width is 15, it is layed out as:
--   
--   
--   (words,
--    in,
--    a,
--    tuple)
--   
--   
--   (If you want put the commas in front of their elements instead of at
--   the end, you should use encloseSep.)
punctuate :: StyleDoc -> [StyleDoc] -> [StyleDoc]

-- | The document (fill i x) renders document x. It than
--   appends (fromString " ")s until the width is equal to
--   i. If the width of x is already larger, nothing is
--   appended. This combinator is quite useful in practice to output a list
--   of bindings. The following example demonstrates this.
--   
--   
--   types = [ ("empty", "Doc a")
--           , ("nest", "Int -> Doc a -> Doc a")
--           , ("linebreak", "Doc a")
--           ]
--   
--   ptype (name, tp) =
--     fill 6 (fromString name) <+> fromString "::" <+> fromString tp
--   
--   test = fromString "let" <+> align (vcat (map ptype types))
--   
--   
--   Which is layed out as:
--   
--   
--   let empty  :: Doc a
--       nest   :: Int -> Doc a -> Doc a
--       linebreak :: Doc a
--   
fill :: Int -> StyleDoc -> StyleDoc

-- | The document (fillBreak i x) first renders document
--   x. It then appends (fromString " ")s until the width
--   is equal to i. If the width of x is already larger
--   than i, the nesting level is increased by i and a
--   line is appended. When we redefine ptype in the
--   previous example to use fillBreak, we get a useful variation
--   of the previous output:
--   
--   
--   ptype (name, tp) =
--     fillBreak 6 (fromString name) <+> fromString "::" <+> fromString tp
--   
--   
--   The output will now be:
--   
--   
--   let empty  :: Doc a
--       nest   :: Int -> Doc a -> Doc a
--       linebreak
--              :: Doc a
--   
fillBreak :: Int -> StyleDoc -> StyleDoc

-- | The document (enclose l r x) encloses document x
--   between documents l and r using (<>).
--   
--   
--   enclose l r x   = l <> x <> r
--   
enclose :: StyleDoc -> StyleDoc -> StyleDoc -> StyleDoc

-- | Document (squotes x) encloses document x with single
--   quotes "'".
squotes :: StyleDoc -> StyleDoc

-- | Document (dquotes x) encloses document x with double
--   quotes '"'.
dquotes :: StyleDoc -> StyleDoc

-- | Document (parens x) encloses document x in
--   parenthesis, "(" and ")".
parens :: StyleDoc -> StyleDoc

-- | Document (angles x) encloses document x in angles,
--   "<" and ">".
angles :: StyleDoc -> StyleDoc

-- | Document (braces x) encloses document x in braces,
--   "{" and "}".
braces :: StyleDoc -> StyleDoc

-- | Document (brackets x) encloses document x in square
--   brackets, "[" and "]".
brackets :: StyleDoc -> StyleDoc

-- | The document string s concatenates all characters in
--   s using line for newline characters and
--   fromString for all other characters. It is used whenever the
--   text contains newline characters.
string :: String -> StyleDoc
annotate :: StyleAnn -> StyleDoc -> StyleDoc

-- | Strip annotations from a document. This is useful for re-using the
--   textual formatting of some sub-document, but applying a different
--   high-level annotation.
noAnnotate :: StyleDoc -> StyleDoc
styleAnn :: Style -> StyleDoc -> StyleDoc
instance GHC.Classes.Eq Text.PrettyPrint.Leijen.Extended.AnsiAnn
instance GHC.Classes.Eq Text.PrettyPrint.Leijen.Extended.SGRTag
instance GHC.Classes.Eq Text.PrettyPrint.Leijen.Extended.StyleAnn
instance GHC.Internal.Data.String.IsString Text.PrettyPrint.Leijen.Extended.StyleDoc
instance GHC.Internal.Base.Monoid Text.PrettyPrint.Leijen.Extended.AnsiAnn
instance GHC.Internal.Base.Monoid Text.PrettyPrint.Leijen.Extended.StyleAnn
instance GHC.Internal.Base.Monoid Text.PrettyPrint.Leijen.Extended.StyleDoc
instance GHC.Classes.Ord Text.PrettyPrint.Leijen.Extended.SGRTag
instance Text.PrettyPrint.Leijen.Extended.Pretty Distribution.System.Arch
instance Text.PrettyPrint.Leijen.Extended.Pretty Distribution.ModuleName.ModuleName
instance Text.PrettyPrint.Leijen.Extended.Pretty Distribution.System.OS
instance Text.PrettyPrint.Leijen.Extended.Pretty (Path.Internal.Posix.Path b Path.Posix.File)
instance Text.PrettyPrint.Leijen.Extended.Pretty (Path.Internal.Posix.Path b Path.Posix.Dir)
instance Text.PrettyPrint.Leijen.Extended.Pretty (Path.Posix.SomeBase Path.Posix.File)
instance Text.PrettyPrint.Leijen.Extended.Pretty (Path.Posix.SomeBase Path.Posix.Dir)
instance Text.PrettyPrint.Leijen.Extended.Pretty Text.PrettyPrint.Leijen.Extended.StyleDoc
instance GHC.Internal.Base.Semigroup Text.PrettyPrint.Leijen.Extended.AnsiAnn
instance GHC.Internal.Base.Semigroup Text.PrettyPrint.Leijen.Extended.StyleAnn
instance GHC.Internal.Base.Semigroup Text.PrettyPrint.Leijen.Extended.StyleDoc
instance GHC.Internal.Show.Show Text.PrettyPrint.Leijen.Extended.AnsiAnn
instance GHC.Internal.Show.Show Text.PrettyPrint.Leijen.Extended.StyleAnn
instance GHC.Internal.Show.Show Text.PrettyPrint.Leijen.Extended.StyleDoc

-- | This module provides a type representing pretty exceptions. It can be
--   used as in the example below:
--   
--   
--   {-# LANGUAGE NoImplicitPrelude #-}
--   {-# LANGUAGE OverloadedStrings #-}
--   
--   module Main (main) where
--   
--   import RIO
--            ( Exception, Handler (..), IO, RIO, Show, SomeException (..), Typeable
--            , ($), catches, displayException, exitFailure, fromString, logError
--            , mempty, throwIO
--            )
--   import RIO.PrettyPrint
--            ( Pretty (..), Style (..), (<+>), prettyError, prettyInfo, style )
--   import RIO.PrettyPrint.PrettyException ( PrettyException (..) )
--   import RIO.PrettyPrint.Simple ( SimplePrettyApp, runSimplePrettyApp )
--   
--   main :: IO ()
--   main = runSimplePrettyApp 80 mempty (action `catches` handleExceptions)
--    where
--     action :: RIO SimplePrettyApp ()
--     action = do
--         prettyInfo "Running action!"
--         throwIO (PrettyException MyPrettyException)
--   
--    handleExceptions :: [Handler (RIO SimplePrettyApp) ()]
--    handleExceptions =
--      [ Handler handlePrettyException
--      , Handler handleSomeException
--      ]
--   
--    handlePrettyException :: PrettyException -> RIO SimplePrettyApp ()
--    handlePrettyException e = do
--      prettyError $ pretty e
--      exitFailure
--   
--    handleSomeException :: SomeException -> RIO SimplePrettyApp ()
--    handleSomeException (SomeException e) = do
--      logError $ fromString $ displayException e
--      exitFailure
--   
--   data MyPrettyException
--     = MyPrettyException
--     deriving (Show, Typeable)
--   
--   instance Pretty MyPrettyException where
--     pretty MyPrettyException =
--       "My" <+> style Highlight "pretty" <+> "exception!"
--   
--   instance Exception MyPrettyException
--   
module RIO.PrettyPrint.PrettyException

-- | Type representing pretty exceptions.
data PrettyException
PrettyException :: e -> PrettyException

-- | Provide the prettiest available information about an exception.
ppException :: SomeException -> StyleDoc

-- | Synchronously throw the given exception as a PrettyException.
prettyThrowIO :: (Exception e, MonadIO m, Pretty e) => e -> m a

-- | Throw the given exception as a PrettyException, when the action
--   is run in the monad m.
prettyThrowM :: (Exception e, MonadThrow m, Pretty e) => e -> m a
instance GHC.Internal.Exception.Type.Exception RIO.PrettyPrint.PrettyException.PrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty RIO.PrettyPrint.PrettyException.PrettyException
instance GHC.Internal.Show.Show RIO.PrettyPrint.PrettyException.PrettyException

module RIO.PrettyPrint
class (HasLogFunc env, HasStylesUpdate env) => HasTerm env
useColorL :: HasTerm env => Lens' env Bool
termWidthL :: HasTerm env => Lens' env Int

-- | Environment values with a styles update.
class HasStylesUpdate env
stylesUpdateL :: HasStylesUpdate env => Lens' env StylesUpdate
displayPlain :: (Pretty a, HasLogFunc env, HasStylesUpdate env, MonadReader env m, HasCallStack) => Int -> a -> m Utf8Builder
displayWithColor :: (HasTerm env, Pretty a, MonadReader env m, HasCallStack) => a -> m Utf8Builder
prettyDebug :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
prettyDebugL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
prettyDebugS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
prettyInfo :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
prettyInfoL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
prettyInfoS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
prettyNote :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
prettyNoteL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
prettyNoteS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
prettyWarn :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
prettyWarnL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
prettyWarnS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
prettyWarnNoIndent :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
prettyWarnNoIndentL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
prettyWarnNoIndentS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
prettyError :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
prettyErrorL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
prettyErrorS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
prettyErrorNoIndent :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
prettyErrorNoIndentL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
prettyErrorNoIndentS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
prettyGeneric :: (HasTerm env, HasCallStack, Pretty b, MonadReader env m, MonadIO m) => LogLevel -> b -> m ()
prettyWith :: (HasTerm env, HasCallStack, Pretty b, MonadReader env m, MonadIO m) => LogLevel -> (a -> b) -> a -> m ()

-- | Annotate a StyleDoc with a Style.
style :: Style -> StyleDoc -> StyleDoc

-- | Display as milliseconds in style Good.
displayMilliseconds :: Double -> StyleDoc

-- | The Style intended to be associated with a LogLevel.
logLevelToStyle :: LogLevel -> Style

-- | A blank line.
blankLine :: StyleDoc

-- | Display a bulleted list of StyleDoc with * as the
--   bullet point.
bulletedList :: [StyleDoc] -> StyleDoc

-- | Display a bulleted list of StyleDoc with a blank line between
--   each and * as the bullet point.
spacedBulletedList :: [StyleDoc] -> StyleDoc

-- | Display a bulleted list of StyleDoc, spaced with blank lines or
--   not, given a character for the bullet point.
mkBulletedList :: Bool -> Char -> [StyleDoc] -> StyleDoc

-- | A helper function to yield a narrative list from a list of items, with
--   a final fullstop. For example, helps produce the output "apple,
--   ball and cat." (no serial comma) or "apple, ball, and
--   cat." (serial comma) from ["apple", "ball", "cat"].
mkNarrativeList :: Pretty a => Maybe Style -> Bool -> [a] -> [StyleDoc]

-- | debug message action brackets any output of the specified
--   action with an initial and final message at log
--   level LevelDebug. The initial message is prefixed with the
--   label Start:. The final message is prefixed with information
--   about the duration of the action in milliseconds (ms) and, if an
--   exception is thrown by the action, the exception. For example:
--   
--   
--   Start: <message>
--   <output of action>
--   Finished in ...ms: <message>
--   
--   
--   or:
--   
--   
--   Start: <message>
--   <output of action>
--   Finished with exception in ...ms: <message>
--   Exception thrown: <exception_message>
--   
debugBracket :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m, MonadUnliftIO m) => StyleDoc -> m a -> m a
class Pretty a
pretty :: Pretty a => a -> StyleDoc
($dmpretty) :: (Pretty a, Show a) => a -> StyleDoc

-- | A document annotated by a style.
data StyleDoc

-- | A style annotation.
newtype StyleAnn
StyleAnn :: Maybe Style -> StyleAnn

-- | The document (nest i x) renders document x with the
--   current indentation level increased by i (See also hang,
--   align and indent).
--   
--   
--      nest 2 (fromString "hello" <> line <> fromString "world")
--   <> line
--   <> fromString "!"
--   
--   
--   outputs as:
--   
--   
--   hello
--     world
--   !
--   
nest :: Int -> StyleDoc -> StyleDoc

-- | The line document advances to the next line and indents to
--   the current nesting level. Document line behaves like
--   (fromString " ") if the line break is undone by group.
line :: StyleDoc

-- | The linebreak document advances to the next line and indents
--   to the current nesting level. Document linebreak behaves like
--   mempty if the line break is undone by group.
linebreak :: StyleDoc

-- | The group combinator is used to specify alternative layouts.
--   The document (group x) undoes all line breaks in document
--   x. The resulting line is added to the current line if that
--   fits the page. Otherwise, the document x is rendered without
--   any changes.
group :: StyleDoc -> StyleDoc

-- | The document softline behaves like (fromString " ")
--   if the resulting output fits the page, otherwise it behaves like
--   line.
--   
--   
--   softline = group line
--   
softline :: StyleDoc

-- | The document softbreak behaves like mempty if the
--   resulting output fits the page, otherwise it behaves like line.
--   
--   
--   softbreak = group linebreak
--   
softbreak :: StyleDoc

-- | The document (align x) renders document x with the
--   nesting level set to the current column. It is used for example to
--   implement hang.
--   
--   As an example, we will put a document right above another one,
--   regardless of the current nesting level:
--   
--   
--   x $$ y = align (x <> line <> y)
--   
--   
--   
--   test = fromString "hi" <+> (fromString "nice" $$ fromString "world")
--   
--   
--   which will be layed out as:
--   
--   
--   hi nice
--      world
--   
align :: StyleDoc -> StyleDoc

-- | The hang combinator implements hanging indentation. The document
--   (hang i x) renders document x with a nesting level
--   set to the current column plus i. The following example uses
--   hanging indentation for some text:
--   
--   
--   test = hang 4 (fillSep (map fromString
--          (words "the hang combinator indents these words !")))
--   
--   
--   Which lays out on a page with a width of 20 characters as:
--   
--   
--   the hang combinator
--       indents these
--       words !
--   
--   
--   The hang combinator is implemented as:
--   
--   
--   hang i x = align (nest i x)
--   
hang :: Int -> StyleDoc -> StyleDoc

-- | The document (indent i x) indents document x with
--   i spaces.
--   
--   
--   test = indent 4 (fillSep (map fromString
--          (words "the indent combinator indents these words !")))
--   
--   
--   Which lays out with a page width of 20 as:
--   
--   
--   the indent
--   combinator
--   indents these
--   words !
--   
indent :: Int -> StyleDoc -> StyleDoc

-- | The document (encloseSep l r sep xs) concatenates the
--   documents xs separated by sep and encloses the
--   resulting document by l and r. The documents are
--   rendered horizontally if that fits the page. Otherwise they are
--   aligned vertically. All separators are put in front of the elements.
--   For example, the combinator list can be defined with
--   encloseSep:
--   
--   
--   list xs = encloseSep lbracket rbracket comma xs
--   test = fromString "list" <+> (list (map int [10, 200, 3000]))
--   
--   
--   Which is layed out with a page width of 20 as:
--   
--   
--   list [10,200,3000]
--   
--   
--   But when the page width is 15, it is layed out as:
--   
--   
--   list [10
--        ,200
--        ,3000]
--   
encloseSep :: StyleDoc -> StyleDoc -> StyleDoc -> [StyleDoc] -> StyleDoc

-- | The document (x <+> y) concatenates document x
--   and y with a (fromString " ") in between. (infixr 6)
(<+>) :: StyleDoc -> StyleDoc -> StyleDoc

-- | The document (hsep xs) concatenates all documents xs
--   horizontally with (<+>).
hsep :: [StyleDoc] -> StyleDoc

-- | The document (vsep xs) concatenates all documents xs
--   vertically with (<> line <>). If a group
--   undoes the line breaks inserted by vsep, all documents are
--   separated with a space.
--   
--   
--   someText = map fromString (words ("text to lay out"))
--   
--   test = fromString "some" <+> vsep someText
--   
--   
--   This is layed out as:
--   
--   
--   some text
--   to
--   lay
--   out
--   
--   
--   The align combinator can be used to align the documents under
--   their first element
--   
--   
--   test = fromString "some" <+> align (vsep someText)
--   
--   
--   Which is printed as:
--   
--   
--   some text
--        to
--        lay
--        out
--   
vsep :: [StyleDoc] -> StyleDoc

-- | The document (fillSep xs) concatenates documents xs
--   horizontally with (<+>) as long as its fits the
--   page, than inserts a line and continues doing that for all
--   documents in xs.
--   
--   
--   fillSep xs = foldr (<> softline <>) mempty xs
--   
fillSep :: [StyleDoc] -> StyleDoc

-- | The document (sep xs) concatenates all documents xs
--   either horizontally with (<+>), if it fits the page, or
--   vertically with (<> line <>).
--   
--   
--   sep xs = group (vsep xs)
--   
sep :: [StyleDoc] -> StyleDoc

-- | The document (hcat xs) concatenates all documents xs
--   horizontally with (<>).
hcat :: [StyleDoc] -> StyleDoc

-- | The document (vcat xs) concatenates all documents xs
--   vertically with (<> linebreak <>). If a
--   group undoes the line breaks inserted by vcat, all
--   documents are directly concatenated.
vcat :: [StyleDoc] -> StyleDoc

-- | The document (fillCat xs) concatenates documents xs
--   horizontally with (<>) as long as its fits the page,
--   than inserts a linebreak and continues doing that for all
--   documents in xs.
--   
--   
--   fillCat xs = foldr (<> softbreak <>) mempty xs
--   
fillCat :: [StyleDoc] -> StyleDoc

-- | The document (cat xs) concatenates all documents xs
--   either horizontally with (<>), if it fits the page, or
--   vertically with (<> linebreak <>).
--   
--   
--   cat xs = group (vcat xs)
--   
cat :: [StyleDoc] -> StyleDoc

-- | (punctuate p xs) concatenates all documents in xs
--   with document p except for the last document.
--   
--   
--   someText = map fromString ["words", "in", "a", "tuple"]
--   test = parens (align (cat (punctuate comma someText)))
--   
--   
--   This is layed out on a page width of 20 as:
--   
--   
--   (words,in,a,tuple)
--   
--   
--   But when the page width is 15, it is layed out as:
--   
--   
--   (words,
--    in,
--    a,
--    tuple)
--   
--   
--   (If you want put the commas in front of their elements instead of at
--   the end, you should use encloseSep.)
punctuate :: StyleDoc -> [StyleDoc] -> [StyleDoc]

-- | The document (fill i x) renders document x. It than
--   appends (fromString " ")s until the width is equal to
--   i. If the width of x is already larger, nothing is
--   appended. This combinator is quite useful in practice to output a list
--   of bindings. The following example demonstrates this.
--   
--   
--   types = [ ("empty", "Doc a")
--           , ("nest", "Int -> Doc a -> Doc a")
--           , ("linebreak", "Doc a")
--           ]
--   
--   ptype (name, tp) =
--     fill 6 (fromString name) <+> fromString "::" <+> fromString tp
--   
--   test = fromString "let" <+> align (vcat (map ptype types))
--   
--   
--   Which is layed out as:
--   
--   
--   let empty  :: Doc a
--       nest   :: Int -> Doc a -> Doc a
--       linebreak :: Doc a
--   
fill :: Int -> StyleDoc -> StyleDoc

-- | The document (fillBreak i x) first renders document
--   x. It then appends (fromString " ")s until the width
--   is equal to i. If the width of x is already larger
--   than i, the nesting level is increased by i and a
--   line is appended. When we redefine ptype in the
--   previous example to use fillBreak, we get a useful variation
--   of the previous output:
--   
--   
--   ptype (name, tp) =
--     fillBreak 6 (fromString name) <+> fromString "::" <+> fromString tp
--   
--   
--   The output will now be:
--   
--   
--   let empty  :: Doc a
--       nest   :: Int -> Doc a -> Doc a
--       linebreak
--              :: Doc a
--   
fillBreak :: Int -> StyleDoc -> StyleDoc

-- | The document (enclose l r x) encloses document x
--   between documents l and r using (<>).
--   
--   
--   enclose l r x   = l <> x <> r
--   
enclose :: StyleDoc -> StyleDoc -> StyleDoc -> StyleDoc

-- | Document (squotes x) encloses document x with single
--   quotes "'".
squotes :: StyleDoc -> StyleDoc

-- | Document (dquotes x) encloses document x with double
--   quotes '"'.
dquotes :: StyleDoc -> StyleDoc

-- | Document (parens x) encloses document x in
--   parenthesis, "(" and ")".
parens :: StyleDoc -> StyleDoc

-- | Document (angles x) encloses document x in angles,
--   "<" and ">".
angles :: StyleDoc -> StyleDoc

-- | Document (braces x) encloses document x in braces,
--   "{" and "}".
braces :: StyleDoc -> StyleDoc

-- | Document (brackets x) encloses document x in square
--   brackets, "[" and "]".
brackets :: StyleDoc -> StyleDoc

-- | The document string s concatenates all characters in
--   s using line for newline characters and
--   fromString for all other characters. It is used whenever the
--   text contains newline characters.
string :: String -> StyleDoc

-- | Use after a label and before the rest of what's being labelled for
--   consistent spacingindentingetc.
--   
--   For example this is used after "Warning:" in warning messages.
indentAfterLabel :: StyleDoc -> StyleDoc

-- | Make a StyleDoc from each word in a String
wordDocs :: String -> [StyleDoc]

-- | Wordwrap a String
flow :: String -> StyleDoc

-- | Type representing styles of output.
data Style

-- | Intended to be used sparingly, not to style entire long messages. For
--   example, to style the Error: or [error] label for an
--   error message, not the entire message.
Error :: Style

-- | Intended to be used sparingly, not to style entire long messages. For
--   example, to style the Warning: or [warn] label for a
--   warning message, not the entire message.
Warning :: Style

-- | Intended to be used sparingly, not to style entire long messages. For
--   example, to style the [info] label for an info message, not
--   the entire message.
Info :: Style

-- | Intended to be used sparingly, not to style entire long messages. For
--   example, to style the [debug] label for a debug message, not
--   the entire message.
Debug :: Style

-- | Intended to be used sparingly, not to style entire long messages. For
--   example, to style the [...] label for an other log level
--   message, not the entire message.
OtherLevel :: Style

-- | Style in a way to emphasize that it is a particularly good thing.
Good :: Style

-- | Style as a shell command, i.e. when suggesting something to the user
--   that should be typed in directly as written.
Shell :: Style

-- | Style as a filename. See Dir for directories.
File :: Style

-- | Style as a URL.
Url :: Style

-- | Style as a directory name. See File for files.
Dir :: Style

-- | Style used to highlight part of a recommended course of action.
Recommendation :: Style

-- | Style in a way that emphasizes that it is related to a current thing.
--   For example, to report the current package that is being processed
--   when outputting the name of it.
Current :: Style

-- | Style used the highlight the target of a course of action.
Target :: Style

-- | Style as a module name.
Module :: Style

-- | Style used to highlight the named component of a package.
PkgComponent :: Style

-- | Style for secondary content. For example, to style timestamps.
Secondary :: Style

-- | Intended to be used sparingly, not to style entire long messages. For
--   example, to style the duration in a Finished process in ...
--   ms message.
Highlight :: Style

-- | This module exports a SimplePrettyApp type, for providing a
--   basic environment including pretty printing functionality.
module RIO.PrettyPrint.Simple

-- | A simple, non-customizable environment type, which provides pretty
--   printing functionality.
data SimplePrettyApp

-- | Constructor for SimplePrettyApp. If ProcessContext is
--   not supplied mkDefaultProcessContext will be used to create it.
mkSimplePrettyApp :: MonadIO m => LogFunc -> Maybe ProcessContext -> Bool -> Int -> StylesUpdate -> m SimplePrettyApp

-- | Run with a default configured SimplePrettyApp, consisting of:
--   
--   
--   
- Logging to stderr
--   
- If the RIO_VERBOSE environment variable is set, turns on
--   verbose logging
--   
- Default process context
--   
- Logging using color
--   
runSimplePrettyApp :: MonadIO m => Int -> StylesUpdate -> RIO SimplePrettyApp a -> m a
instance RIO.Prelude.Logger.HasLogFunc RIO.PrettyPrint.Simple.SimplePrettyApp
instance RIO.Process.HasProcessContext RIO.PrettyPrint.Simple.SimplePrettyApp
instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate RIO.PrettyPrint.Simple.SimplePrettyApp
instance RIO.PrettyPrint.HasTerm RIO.PrettyPrint.Simple.SimplePrettyApp
