| 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 where
- redactSGRs :: Color -> ColorIntensity -> [SGR]
- resetSGRs :: [SGR]
- reset :: MonadTerminal m => m ()
- putLines :: forall m. MonadTerminal m => [SGR] -> [Line] -> m ()
- initialize :: MonadTerminal m => [SGR] -> Line -> m ()
- putLine :: forall m. MonadTerminal m => [SGR] -> Line -> Maybe Line -> m ()
MonadTerminal
class Monad m => MonadTerminal m where Source #
Terminal output
Since: 0.4.0.0
API
redactSGRs :: Color -> ColorIntensity -> [SGR] Source #
Construct SGRs 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 :: forall m. 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.
Arguments
| :: forall m. MonadTerminal m | |
| => [SGR] |
|
| -> Line | line to put |
| -> Maybe Line | |
| -> m () |
Put a line of redacted text to the terminal
The colors for the line is assumed to be already set. Be sure to call
initialize before putting the first line.