darcs-2.16.5: a distributed, interactive, smart revision control system

Safe Haskell | Safe-Inferred
Language | Haskell2010

Darcs.Patch.MonadProgress

Synopsis

- class Monad m => MonadProgress m where
  - runProgressActions :: String -> [ProgressAction m ()] -> m ()
- data ProgressAction m a = ProgressAction {
  - paAction :: m a
  - paMessage :: Doc
  - paOnError :: Doc
  }
- silentlyRunProgressActions :: Monad m => String -> [ProgressAction m ()] -> m ()

# Documentation

class Monad m => MonadProgress m where #

Methods

runProgressActions :: String -> [ProgressAction m ()] -> m () #

run a list of `ProgressAction`s. In some monads (typically IO-based ones), the progress and error messages will be used. In others they will be ignored and just the actions will be run.

#### Instances

Instances details

MonadProgress DefaultIO # |
Instance details Defined in Darcs.Repository.ApplyPatches Methods runProgressActions :: String -> [ProgressAction DefaultIO ()] -> DefaultIO () #
Monad m => MonadProgress (TreeMonad m) # |
Instance details Defined in Darcs.Patch.MonadProgress Methods runProgressActions :: String -> [ProgressAction (TreeMonad m) ()] -> TreeMonad m () #

data ProgressAction m a #

a monadic action, annotated with a progress message that could be printed out while running the action, and a message that could be printed out on error. Actually printing out these messages is optional to allow non-IO monads to just run the action.

Constructors

ProgressAction |
Fields paAction :: m a paMessage :: Doc paOnError :: Doc

silentlyRunProgressActions :: Monad m => String -> [ProgressAction m ()] -> m () #

run a list of `ProgressAction`s without any feedback messages