Copyright | Copyright (c) 2020-2024 Travis Cardwell |
---|---|
License | MIT |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Redact.Monad.Terminal
Contents
Description
Synopsis
- class Monad m => MonadTerminal (m :: Type -> Type) where
- redactSGRs :: Color -> ColorIntensity -> [SGR]
- resetSGRs :: [SGR]
- reset :: MonadTerminal m => m ()
- putLines :: MonadTerminal m => [SGR] -> [Line] -> m ()
- initialize :: MonadTerminal m => [SGR] -> Line -> m ()
- putLine :: MonadTerminal m => [SGR] -> Line -> Maybe Line -> m ()
MonadTerminal
class Monad m => MonadTerminal (m :: Type -> Type) where Source #
Terminal output
Since: 0.4.0.0
API
redactSGRs :: Color -> ColorIntensity -> [SGR] Source #
Construct SGR
s for redacted text
Since: 0.4.0.0
reset :: MonadTerminal m => m () Source #
Reset the terminal color mode and go to the next line
Since: 0.4.0.0
putLines :: MonadTerminal m => [SGR] -> [Line] -> m () Source #
Put redacted text to the terminal
It is assumed that the terminal is set to display normal colors when this
function is called. If the first Line
is a RedactLine
, then an extra
blank line is first output in order to set the colors. The terminal is set
to display normal colors when this function exits.
Since: 0.4.0.0
Internal
Arguments
:: MonadTerminal m | |
=> [SGR] |
|
-> Line | first line |
-> m () |
Initialize the terminal colors
When the first line is a RedactLine
, an extra blank line is output in
order to set the terminal colors.