MissingH-1.4.1.0: Large utility library

Data.Progress.Meter

Description

Tool for maintaining a status bar, supporting multiple simultaneous tasks, as a layer atop Data.Progress.Tracker.

Written by John Goerzen, jgoerzen@complete.org

Synopsis

# Types

type ProgressMeter = MVar ProgressMeterR Source #

# Creation and Configuration

Set up a new status bar using defaults:

• The given tracker
• Width 80
• Data.Quantity.renderNums binaryOpts 1
• Unit inticator B

Arguments

 :: Progress The top-level Progress -> String Unit indicator string -> Int Width of the terminal -- usually 80 -> ([Integer] -> [String]) A function to render sizes -> IO ProgressMeter

Set up a new status bar.

setComponents :: ProgressMeter -> [Progress] -> IO () Source #

Adjust the list of components of this ProgressMeter.

Add a new component to the list of components.

Remove a component by name.

Adjusts the width of this ProgressMeter.

# Rendering and Output

Render the current status.

Like renderMeter, but prints it to the screen instead of returning it.

This function will output CR, then the meter.

Pass stdout as the handle for regular display to the screen.

Clears the meter -- outputs CR, spaces equal to the width - 1, then another CR.

Pass stdout as the handle for regular display to the screen.

Clears the meter, writes the given string, then restores the meter. The string is assumed to contain a trailing newline.

Pass stdout as the handle for regular display to the screen.

Arguments

 :: ProgressMeter The meter to display -> Int Update interval in seconds -> (ProgressMeter -> IO ()) Function to display it -> IO ThreadId Resulting thread id

Starts a thread that updates the meter every n seconds by calling the specified function. Note: displayMeter stdout is an ideal function here.

Save this threadID and use it later to call stopAutoDisplayMeter.

Stops the specified meter from displaying.

You should probably call clearMeter after a call to this.