xrefcheck-0.1.3
Safe HaskellNone
LanguageHaskell2010

Xrefcheck.Progress

Description

Printing progress bars.

Synopsis

Progress

data Progress a Source #

Processing progress of any thing.

Constructors

Progress 

Fields

  • pCurrent :: a

    How much has been completed.

  • pTotal :: a

    Overall amount of work.

  • pErrors :: !a

    How many of the completed work finished with an error.

Instances

Instances details
Show a => Show (Progress a) Source # 
Instance details

Defined in Xrefcheck.Progress

Methods

showsPrec :: Int -> Progress a -> ShowS #

show :: Progress a -> String #

showList :: [Progress a] -> ShowS #

initProgress :: Num a => a -> Progress a Source #

Initialise null progress.

incProgress :: (Num a, Show a) => Progress a -> Progress a Source #

Increase progress amount.

incProgressErrors :: (Num a, Show a) => Progress a -> Progress a Source #

Increase errors amount.

showProgress :: Text -> Int -> Color -> Progress Int -> Text Source #

Visualise progress bar.

Printing

data Rewrite Source #

Passing this object allows returning caret and replace text in line. Only functions which has this thing can do that because being interleaved with putTextLn printing caret symbol produced garbage.

allowRewrite :: (MonadIO m, MonadMask m) => Bool -> (Rewrite -> m a) -> m a Source #

Provide context for rewrite operations.

putTextRewrite :: MonadIO m => Rewrite -> Text -> m () Source #

Return caret and print the given text.