System.Console.Terminfo.PrettyPrint
Contents
- data ScopedEffect
- = Bold
- | Standout
- | Underline
- | Reverse
- | Blink
- | Dim
- | Invisible
- | Protected
- | Foreground Color
- | Background Color
- | Else ScopedEffect ScopedEffect
- | Nop
- with :: ScopedEffect -> TermDoc -> TermDoc
- data Effect
- = Push ScopedEffect
- | Pop
- | Ring Bell
- class HasEffect e where
- soft :: ScopedEffect -> ScopedEffect
- red, dim, invisible, protected, reversed, standout, underline, bold, blink, white, cyan, magenta, blue, yellow, green, black :: TermDoc -> TermDoc
- foreground, background :: Color -> TermDoc -> TermDoc
- data Bell
- ring :: Bell -> TermDoc
- type TermDoc = Doc Effect
- display :: PrettyTerm t => t -> IO ()
- displayLn :: PrettyTerm t => t -> IO ()
- displayDoc :: PrettyTerm t => Float -> t -> IO ()
- displayDoc' :: PrettyTerm t => Terminal -> Float -> t -> IO ()
- displayDoc'' :: PrettyTerm t => Terminal -> Float -> Int -> t -> IO ()
- class Pretty t => PrettyTerm t where
- prettyTerm :: t -> TermDoc
- prettyTermList :: [t] -> TermDoc
- type SimpleTermDoc = SimpleDoc Effect
- evalTermState :: Monad m => StateT TermState m a -> m a
- displayCap :: SimpleTermDoc -> StateT TermState Capability TermOutput
Raw Effect (requires the effect be present)
data ScopedEffect Source
Constructors
| Bold | |
| Standout | |
| Underline | |
| Reverse | |
| Blink | |
| Dim | |
| Invisible | |
| Protected | |
| Foreground Color | |
| Background Color | |
| Else ScopedEffect ScopedEffect | |
| Nop |
Instances
with :: ScopedEffect -> TermDoc -> TermDocSource
Graceful degradation
Effects (built with soft)
red, dim, invisible, protected, reversed, standout, underline, bold, blink, white, cyan, magenta, blue, yellow, green, black :: TermDoc -> TermDocSource
Colors (built with soft)
foreground, background :: Color -> TermDoc -> TermDocSource
Ringing bells
A Color Pretty Printer
display :: PrettyTerm t => t -> IO ()Source
displayLn :: PrettyTerm t => t -> IO ()Source
Progressively less magical formatting
displayDoc :: PrettyTerm t => Float -> t -> IO ()Source
displayDoc' :: PrettyTerm t => Terminal -> Float -> t -> IO ()Source
displayDoc'' :: PrettyTerm t => Terminal -> Float -> Int -> t -> IO ()Source
A Classy Interface
class Pretty t => PrettyTerm t whereSource
Instances
| PrettyTerm Bool | |
| PrettyTerm Char | |
| PrettyTerm Double | |
| PrettyTerm Float | |
| PrettyTerm Int | |
| PrettyTerm Integer | |
| PrettyTerm () | |
| PrettyTerm ByteString | |
| PrettyTerm ByteString | |
| PrettyTerm Natural | |
| PrettyTerm t => PrettyTerm [t] | |
| PrettyTerm a => PrettyTerm (Maybe a) | |
| PrettyTerm a => PrettyTerm (Seq a) | |
| PrettyTerm a => PrettyTerm (NonEmpty a) | |
| HasEffect e => PrettyTerm (Doc e) | |
| (PrettyTerm a, PrettyTerm b) => PrettyTerm (a, b) | |
| (PrettyTerm a, PrettyTerm b, PrettyTerm c) => PrettyTerm (a, b, c) |
Evaluation
type SimpleTermDoc = SimpleDoc EffectSource
evalTermState :: Monad m => StateT TermState m a -> m aSource
displayCap :: SimpleTermDoc -> StateT TermState Capability TermOutputSource