Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class (HasLogFunc env, HasStylesUpdate env) => HasTerm env where
- class HasStylesUpdate env where
- stylesUpdateL :: 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 ()
- prettyInfo :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
- prettyNote :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
- prettyWarn :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
- prettyError :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
- prettyWarnNoIndent :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
- prettyErrorNoIndent :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
- prettyDebugL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
- prettyInfoL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
- prettyNoteL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
- prettyWarnL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
- prettyErrorL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
- prettyWarnNoIndentL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
- prettyErrorNoIndentL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
- prettyDebugS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
- prettyInfoS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
- prettyNoteS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
- prettyWarnS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
- prettyErrorS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
- prettyWarnNoIndentS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
- prettyErrorNoIndentS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
- style :: Style -> StyleDoc -> StyleDoc
- displayMilliseconds :: Double -> StyleDoc
- logLevelToStyle :: LogLevel -> Style
- bulletedList :: [StyleDoc] -> StyleDoc
- mkNarrativeList :: Pretty a => Maybe Style -> Bool -> [a] -> [StyleDoc]
- spacedBulletedList :: [StyleDoc] -> StyleDoc
- debugBracket :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m, MonadUnliftIO m) => StyleDoc -> m a -> m a
- class Pretty a where
- data StyleDoc
- newtype StyleAnn = StyleAnn (Maybe Style)
- nest :: Int -> StyleDoc -> StyleDoc
- line :: StyleDoc
- linebreak :: StyleDoc
- group :: StyleDoc -> StyleDoc
- softline :: StyleDoc
- softbreak :: StyleDoc
- align :: StyleDoc -> StyleDoc
- hang :: Int -> StyleDoc -> StyleDoc
- indent :: Int -> StyleDoc -> StyleDoc
- encloseSep :: StyleDoc -> StyleDoc -> StyleDoc -> [StyleDoc] -> StyleDoc
- (<+>) :: StyleDoc -> StyleDoc -> StyleDoc
- hsep :: [StyleDoc] -> StyleDoc
- vsep :: [StyleDoc] -> StyleDoc
- fillSep :: [StyleDoc] -> StyleDoc
- sep :: [StyleDoc] -> StyleDoc
- hcat :: [StyleDoc] -> StyleDoc
- vcat :: [StyleDoc] -> StyleDoc
- fillCat :: [StyleDoc] -> StyleDoc
- cat :: [StyleDoc] -> StyleDoc
- punctuate :: StyleDoc -> [StyleDoc] -> [StyleDoc]
- fill :: Int -> StyleDoc -> StyleDoc
- fillBreak :: Int -> StyleDoc -> StyleDoc
- enclose :: StyleDoc -> StyleDoc -> StyleDoc -> StyleDoc
- squotes :: StyleDoc -> StyleDoc
- dquotes :: StyleDoc -> StyleDoc
- parens :: StyleDoc -> StyleDoc
- angles :: StyleDoc -> StyleDoc
- braces :: StyleDoc -> StyleDoc
- brackets :: StyleDoc -> StyleDoc
- string :: String -> StyleDoc
- indentAfterLabel :: StyleDoc -> StyleDoc
- wordDocs :: String -> [StyleDoc]
- flow :: String -> StyleDoc
- data Style
Type classes for optionally colored terminal output
class (HasLogFunc env, HasStylesUpdate env) => HasTerm env where Source #
Instances
class HasStylesUpdate env where Source #
Environment values with a styles update.
Since: 0.1.0.0
stylesUpdateL :: Lens' env StylesUpdate Source #
Instances
Pretty printing functions
displayPlain :: (Pretty a, HasLogFunc env, HasStylesUpdate env, MonadReader env m, HasCallStack) => Int -> a -> m Utf8Builder Source #
displayWithColor :: (HasTerm env, Pretty a, MonadReader env m, HasCallStack) => a -> m Utf8Builder Source #
Logging based on pretty-print typeclass
prettyDebug :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m () Source #
prettyInfo :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m () Source #
prettyNote :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m () Source #
prettyWarn :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m () Source #
prettyError :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m () Source #
prettyWarnNoIndent :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m () Source #
prettyErrorNoIndent :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m () Source #
prettyDebugL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m () Source #
prettyInfoL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m () Source #
prettyNoteL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m () Source #
prettyWarnL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m () Source #
prettyErrorL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m () Source #
prettyWarnNoIndentL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m () Source #
prettyErrorNoIndentL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m () Source #
prettyDebugS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m () Source #
prettyInfoS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m () Source #
prettyNoteS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m () Source #
prettyWarnS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m () Source #
prettyErrorS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m () Source #
prettyWarnNoIndentS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m () Source #
prettyErrorNoIndentS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m () Source #
Semantic styling functions
These are used rather than applying colors or other styling directly, to provide consistency.
displayMilliseconds :: Double -> StyleDoc Source #
logLevelToStyle :: LogLevel -> Style Source #
Formatting utils
:: Pretty a | |
=> Maybe Style | Style the items in the list? |
-> Bool | Use a serial comma? |
-> [a] | |
-> [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"]
.
Since: 0.1.4.0
spacedBulletedList :: [StyleDoc] -> StyleDoc Source #
Display a bulleted list of StyleDoc
with a blank line between
each.
debugBracket :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m, MonadUnliftIO m) => StyleDoc -> m a -> m a Source #
Re-exports from Text.PrettyPrint.Leijen.Extended
Nothing
Instances
Pretty ModuleName Source # | |
Defined in Text.PrettyPrint.Leijen.Extended pretty :: ModuleName -> StyleDoc Source # | |
Pretty PrettyException Source # | |
Defined in RIO.PrettyPrint.PrettyException pretty :: PrettyException -> StyleDoc Source # | |
Pretty StyleDoc Source # | |
Pretty (Path b Dir) Source # | |
Pretty (Path b File) Source # | |
A document annotated by a style
A style annotation.
string :: String -> StyleDoc Source #
The document string s
concatenates all characters in s
using line
for
newline characters and char
for all other characters. It is used whenever
the text contains newline characters.
Since: 0.1.4.0
indentAfterLabel :: StyleDoc -> StyleDoc Source #
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.
Re-exports from RIO.PrettyPrint.Types.PrettyPrint
A style of rio-prettyprint's output.
Error | |
Warning | |
Info | |
Debug | |
OtherLevel | |
Good | |
Shell | |
File | |
Url | |
Dir | |
Recommendation | |
Current | |
Target | |
Module | |
PkgComponent | |
Secondary | |
Highlight |