rio-prettyprint-0.1.8.0: Pretty-printing for RIO

Safe Haskell | None
Language | Haskell2010

RIO.PrettyPrint.Types

Description

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

Synopsis

- data Style
  - = Error
  - | Warning
  - | Info
  - | Debug
  - | OtherLevel
  - | Good
  - | Shell
  - | File
  - | Url
  - | Dir
  - | Recommendation
  - | Current
  - | Target
  - | Module
  - | PkgComponent
  - | Secondary
  - | Highlight
- type Styles = Array Style StyleSpec
- type StyleSpec = (Text, [SGR])

# Documentation

data Style Source #

Type representing styles of output.

Constructors

Error | 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.
Warning | 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.
Info | 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.
Debug | 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.
OtherLevel | 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.
Good | Style in a way to emphasize that it is a particularly good thing.
Shell | Style as a shell command, i.e. when suggesting something to the user that should be typed in directly as written.
File | Style as a filename. See `Dir` for directories.
Url | Style as a URL.
Dir | Style as a directory name. See `File` for files.
Recommendation | Style used to highlight part of a recommended course of action.
Current | 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.
Target | Style used the highlight the target of a course of action.
Module | Style as a module name.
PkgComponent | Style used to highlight the named component of a package.
Secondary | Style for secondary content. For example, to style timestamps.
Highlight | Intended to be used sparingly, not to style entire long messages. For example, to style the duration in a `Finished process in ... ms` message.

#### Instances

Instances details

Semigroup Style Source # | The first style overrides the second.
Instance details Defined in RIO.PrettyPrint.Types Methods (<>) :: Style -> Style -> Style Source # sconcat :: NonEmpty Style -> Style Source # stimes :: Integral b => b -> Style -> Style Source #
Bounded Style Source # |
Instance details Defined in RIO.PrettyPrint.Types Methods minBound :: Style Source # maxBound :: Style Source #
Enum Style Source # |
Instance details Defined in RIO.PrettyPrint.Types Methods succ :: Style -> Style Source # pred :: Style -> Style Source # toEnum :: Int -> Style Source # fromEnum :: Style -> Int Source # enumFrom :: Style -> [Style] Source # enumFromThen :: Style -> Style -> [Style] Source # enumFromTo :: Style -> Style -> [Style] Source # enumFromThenTo :: Style -> Style -> Style -> [Style] Source #
Ix Style Source # |
Instance details Defined in RIO.PrettyPrint.Types Methods range :: (Style, Style) -> [Style] Source # index :: (Style, Style) -> Style -> Int Source # unsafeIndex :: (Style, Style) -> Style -> Int Source # inRange :: (Style, Style) -> Style -> Bool Source # rangeSize :: (Style, Style) -> Int Source # unsafeRangeSize :: (Style, Style) -> Int Source #
Show Style Source # |
Instance details Defined in RIO.PrettyPrint.Types Methods showsPrec :: Int -> Style -> ShowS Source # show :: Style -> String Source # showList :: [Style] -> ShowS Source #
Eq Style Source # |
Instance details Defined in RIO.PrettyPrint.Types Methods (==) :: Style -> Style -> Bool Source # (/=) :: Style -> Style -> Bool Source #
Ord Style Source # |
Instance details Defined in RIO.PrettyPrint.Types Methods compare :: Style -> Style -> Ordering Source # (<) :: Style -> Style -> Bool Source # (<=) :: Style -> Style -> Bool Source # (>) :: Style -> Style -> Bool Source # (>=) :: Style -> Style -> Bool Source # max :: Style -> Style -> Style Source # min :: Style -> Style -> Style Source #

type Styles = Array Style StyleSpec Source #

Style specifications indexed by the style.

type StyleSpec = (Text, [SGR]) Source #

A style specification, pairing its 'key' with the corresponding list of `SGR` codes.