Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data ProgressBar = ProgressBar {
- pgInfo :: ProgressBarInfo
- pgFuture :: Async ()
- data Options = Options {
- pgFormat :: String
- pgCompletedChar :: Char
- pgPendingChar :: Char
- pgTotal :: Int
- pgWidth :: Int
- pgOnCompletion :: IO ()
- data Stats = Stats {}
- isComplete :: ProgressBar -> IO Bool
- newProgressBar :: Options -> IO ProgressBar
- complete :: ProgressBar -> IO ()
- tick :: ProgressBar -> IO ()
- tickN :: ProgressBar -> Int -> IO ()
- getProgressStrIO :: ProgressBar -> IO String
- getProgressStats :: ProgressBar -> IO Stats
- getProgressStr :: Options -> Stats -> String
- registerLn :: IO ()
- class Default a where
- def :: a
Documentation
data ProgressBar Source
ProgressBar | |
|
The progress bar's options.
Options | |
|
Represents a point in time for the progress bar.
isComplete :: ProgressBar -> IO Bool Source
Returns if the progress bar rendering thread has exited (it has done enough ticks)
newProgressBar :: Options -> IO ProgressBar Source
Creates a new progress bar with the given Options
. Multiple progress bars
may be created as long as everytime a line is outputted by your program,
while progress bars run is followed by a call to registerLn
complete :: ProgressBar -> IO () Source
Forces a ProgressBar
to finish
tick :: ProgressBar -> IO () Source
Tick the progress bar
tickN :: ProgressBar -> Int -> IO () Source
Tick the progress bar N times
getProgressStrIO :: ProgressBar -> IO String Source
Like getProgressStr
but works on the ProgressBar
object and uses the IO
monad.
getProgressStats :: ProgressBar -> IO Stats Source
Gets the progress bar current Stats
object
getProgressStr :: Options -> Stats -> String Source
Gets the string to be printed given the options object and a certain stats object representing the rendering moment.
registerLn :: IO () Source
Registers a new line for multiple progress bars
class Default a where
A class for types with a default value.
def :: a
The default value for this type.