process-extras-0.7.4: Process extras

Safe Haskell | None
Language | Haskell2010

System.Process.Run

Contents

- Monad transformer
- Monad class
- Modify moand RunM state parameters
- Monadic process runner
- Re-exports

Description

Flexible control of progress reporting for readCreateProcess and friends.

Synopsis

- type RunT text (m :: Type -> Type) = StateT (RunState text) m
- runT :: (MonadIO m, ProcessText text char) => RunT text m a -> m a
- data RunState text = RunState {
  - _output :: OutputStyle
  - _outprefix :: text
  - _errprefix :: text
  - _echoStart :: Bool
  - _echoEnd :: Bool
  - _verbosity :: Int
  - _lazy :: Bool
  - _message :: text
  }
- data OutputStyle
  - = Dots Int
  - | All
  - | Indented
  - | Silent
- class (MonadState (RunState text) m, ProcessText text char, ListLikeProcessIO text char, MonadIO m, IsString text, Eq char, Dot char) => RunM text char (m :: Type -> Type)
- echoStart :: MonadState (RunState t) m => m ()
- echoEnd :: MonadState (RunState t) m => m ()
- output :: MonadState (RunState t) m => m ()
- silent :: MonadState (RunState t) m => m ()
- dots :: MonadState (RunState t) m => Int -> m ()
- indent :: (MonadState (RunState t) m, ListLike t char) => (t -> t) -> (t -> t) -> m ()
- vlevel :: forall m text char. (IsString text, ListLike text char, MonadIO m, MonadState (RunState text) m) => Int -> m ()
- quieter :: RunM text char m => m ()
- noisier :: RunM text char m => m ()
- lazy :: RunM text char m => m ()
- strict :: RunM text char m => m ()
- message :: RunM text char m => (text -> text) -> m ()
- run :: forall m maker text char result. (RunM text char m, ProcessMaker maker, ProcessResult text result) => maker -> text -> m result
- module System.Process.ListLike

# Monad transformer

type RunT text (m :: Type -> Type) = StateT (RunState text) m Source #

runT :: (MonadIO m, ProcessText text char) => RunT text m a -> m a Source #

data RunState text Source #

This is the state record that controls the output style.

Constructors

RunState |

Fields

- _output :: OutputStyle

  Overall style of output

- _outprefix :: text

  Prefix for lines of stdout

- _errprefix :: text

  Prefix for lines of stderr

- _echoStart :: Bool

  Echo command as process starts

- _echoEnd :: Bool

  Echo command as process finishes

- _verbosity :: Int

  A progression of progress modes

- _lazy :: Bool

  Use the lazy or strict runner?

- _message :: text

  Extra text for start/end message - e.g. the change root

#### Instances

Instances details

ProcessText text char => Default (RunState text) Source # |
Instance details Defined in System.Process.Run Methods def :: RunState text Source #

data OutputStyle Source #

Constructors

Dots Int | Output one dot per n output characters
All | send process stdout to console stdout and process stderr to console stderr
Indented | Output with prefixes
Silent | No output

# Monad class

class (MonadState (RunState text) m, ProcessText text char, ListLikeProcessIO text char, MonadIO m, IsString text, Eq char, Dot char) => RunM text char (m :: Type -> Type) Source #

#### Instances

Instances details

(MonadIO m, MonadState (RunState ByteString) m) => RunM ByteString Word8 m Source # |
Instance details Defined in System.Process.Run
(MonadIO m, MonadState (RunState ByteString) m) => RunM ByteString Word8 m Source # |
Instance details Defined in System.Process.Run
(MonadIO m, MonadState (RunState Text) m) => RunM Text Char m Source # |
Instance details Defined in System.Process.Run
(MonadIO m, MonadState (RunState Text) m) => RunM Text Char m Source # |
Instance details Defined in System.Process.Run
(MonadIO m, MonadState (RunState String) m) => RunM String Char m Source # |
Instance details Defined in System.Process.Run

# Modify moand RunM state parameters

echoStart :: MonadState (RunState t) m => m () Source #

echoEnd :: MonadState (RunState t) m => m () Source #

output :: MonadState (RunState t) m => m () Source #

silent :: MonadState (RunState t) m => m () Source #

dots :: MonadState (RunState t) m => Int -> m () Source #

indent :: (MonadState (RunState t) m, ListLike t char) => (t -> t) -> (t -> t) -> m () Source #

Modify the indentation prefixes for stdout and stderr in the progress monad.

vlevel :: forall m text char. (IsString text, ListLike text char, MonadIO m, MonadState (RunState text) m) => Int -> m () Source #

Set verbosity to a specific level from 0 to 3. vlevel :: (MonadIO m, Monoid text, MonadState (RunState text) m) => Int -> m () vlevel :: forall m text char. (IsString text, ListLike text char, MonadIO m) => Int -> m ()

quieter :: RunM text char m => m () Source #

noisier :: RunM text char m => m () Source #

lazy :: RunM text char m => m () Source #

strict :: RunM text char m => m () Source #

message :: RunM text char m => (text -> text) -> m () Source #

# Monadic process runner

run :: forall m maker text char result. (RunM text char m, ProcessMaker maker, ProcessResult text result) => maker -> text -> m result Source #

# Re-exports

module System.Process.ListLike