process-streaming-0.7.2.0: Streaming interface to system processes.

Safe HaskellNone
LanguageHaskell2010

System.Process.Streaming.Internal

Synopsis

Documentation

data Piping e a Source

A Piping determines what standard streams will be piped and what to do with them.

The user doesn't need to manually set the std_in, std_out and std_err fields of the CreateProcess record to CreatePipe, this is done automatically.

A Piping is parametrized by the type e of errors that can abort the processing of the streams.

Instances

Bifunctor Piping

first is useful to massage errors.

Functor (Piping e) 

newtype Piap e a Source

An alternative to Piping for defining what to do with the standard streams. Piap is an instance of Applicative, unlike Piping.

With Piap, the standard streams are always piped. The values of std_in, std_out and std_err in the CreateProcess record are ignored.

Constructors

Piap 

Instances

Bifunctor Piap 
Functor (Piap e) 
Applicative (Piap e)

pure creates a Piap that writes nothing to stdin and drains stdout and stderr, discarding the data.

<*> schedules the writes to stdin sequentially, and the reads from stdout and stderr concurrently.

newtype Pump b e a Source

Pumps are actions that write data into a process' stdin.

Constructors

Pump 

Fields

runPump :: Consumer b IO () -> IO (Either e a)
 

Instances

Bifunctor (Pump b)

first is useful to massage errors.

Functor (Pump b e) 
Applicative (Pump b e)

pure writes nothing to stdin.

<*> sequences the writes to stdin.

Monoid a => Monoid (Pump b e a) 

newtype Siphon b e a Source

A Siphon represents a computation that completely drains a Producer, but which may fail early with an error of type e.

Constructors

Siphon (Lift (Siphon_ b e) a) 

Instances

Bifunctor (Siphon b)

first is useful to massage errors.

Functor (Siphon b e) 
Applicative (Siphon b e)

pure creates a Siphon that does nothing besides draining the Producer.

<*> executes its arguments concurrently. The Producer is forked so that each argument receives its own copy of the data.

Monoid a => Monoid (Siphon b e a) 

runSiphon :: Siphon b e a -> Producer b IO r -> IO (Either e (a, r)) Source

runSiphonDumb :: Siphon b e a -> Producer b IO () -> IO (Either e a) Source

data Siphon_ b e a Source

Constructors

Exhaustive (forall r. Producer b IO r -> IO (Either e (a, r))) 
Nonexhaustive (Producer b IO () -> IO (Either e a)) 

Instances

exhaustive :: Siphon_ b e a -> Producer b IO r -> IO (Either e (a, r)) Source

data Lines e Source

A configuration parameter used in functions that combine lines of text from multiple streams.

Constructors

Lines 

Fields

teardown :: (forall r. Producer Text IO r -> Producer Text IO r) -> (FreeT (Producer Text IO) IO (Producer ByteString IO ()) -> IO (Producer ByteString IO ())) -> Producer ByteString IO () -> IO (Either e ())
 
lineTweaker :: forall r. Producer Text IO r -> Producer Text IO r
 

Instances

Functor Lines

fmap maps over the encoding error.

newtype Splitter b Source

Constructors

Splitter 

Fields

getSplitter :: forall r. Producer b IO r -> FreeT (Producer b IO) IO r
 

combined :: Lines e -> Lines e -> (Producer Text IO () -> IO (Either e a)) -> Producer ByteString IO () -> Producer ByteString IO () -> IO (Either e a) Source

manyCombined :: [(FreeT (Producer Text IO) IO (Producer ByteString IO ()) -> IO (Producer ByteString IO ())) -> IO (Either e ())] -> (Producer Text IO () -> IO (Either e a)) -> IO (Either e a) Source

data Stage e Source

An individual stage in a process pipeline.

Instances