License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | Good |
Safe Haskell | Safe |
Language | Haskell2010 |
Displaying utilities
- data TerminalDisplay
- displayInit :: IO TerminalDisplay
- display :: TerminalDisplay -> [OutputElem] -> IO ()
- displayTextColor :: TerminalDisplay -> Color -> String -> IO ()
- displayLn :: TerminalDisplay -> Color -> String -> IO ()
- data ProgressBar
- progress :: TerminalDisplay -> Int -> (ProgressBar -> IO a) -> IO a
- progressTick :: ProgressBar -> IO ()
- data Summary
- summary :: TerminalDisplay -> IO Summary
- summarySet :: Summary -> [OutputElem] -> IO ()
- data Color :: *
- data OutputElem
- termText :: String -> TermOutput
- justify :: Justify -> Int -> String -> String
- data Justify
- data Table
- data Column
- columnNew :: Int -> String -> Column
- tableCreate :: [Column] -> Table
- tableHeaders :: TerminalDisplay -> Table -> IO ()
- tableAppend :: TerminalDisplay -> Table -> [String] -> IO ()
Documentation
data TerminalDisplay Source
Terminal display state
Basic
displayInit :: IO TerminalDisplay Source
Create a new display
display :: TerminalDisplay -> [OutputElem] -> IO () Source
Display
displayTextColor :: TerminalDisplay -> Color -> String -> IO () Source
A simple utility that display a msg
in color
displayLn :: TerminalDisplay -> Color -> String -> IO () Source
A simple utility that display a msg
in color
and newline at the end.
Progress Bar
data ProgressBar Source
Progress bar widget
progress :: TerminalDisplay -> Int -> (ProgressBar -> IO a) -> IO a Source
Create a new progress bar context
progressTick :: ProgressBar -> IO () Source
Tick an element on the progress bar
Summary line
summary :: TerminalDisplay -> IO Summary Source
Create a summary
summarySet :: Summary -> [OutputElem] -> IO () Source
Set the summary
Attributes
data Color :: *
data OutputElem Source
Element to output text and attributes to the display
termText :: String -> TermOutput
justify :: Justify -> Int -> String -> String Source
box a string to a specific size, choosing the justification
Table
tableCreate :: [Column] -> Table Source
Create a new table
tableHeaders :: TerminalDisplay -> Table -> IO () Source
Show the table headers
tableAppend :: TerminalDisplay -> Table -> [String] -> IO () Source
Append a row to the table.
if the number of elements is greater than the amount of column the table has been configured with, the extra elements are dropped.