Data.Conduit.Process.Typed

conduit-extra-1.3.6: Batteries included conduit: adapters for common libraries.

Safe Haskell | None
Language | Haskell2010

Data.Conduit.Process.Typed

Contents

- Conduit specific stuff
- Running a process with logging
- Reexports

Description

The System.Process.Typed module from `typed-process`, but with added conduit helpers.

Synopsis

- createSink :: forall (m :: Type -> Type) o. MonadIO m => StreamSpec 'STInput (ConduitM ByteString o m ())
- createSinkClose :: forall (m :: Type -> Type) o. MonadIO m => StreamSpec 'STInput (ConduitM ByteString o m ())
- createSource :: forall (m :: Type -> Type) i. MonadIO m => StreamSpec 'STOutput (ConduitM i ByteString m ())
- withLoggedProcess_ :: MonadUnliftIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> (Process stdin (ConduitM () ByteString m ()) (ConduitM () ByteString m ()) -> m a) -> m a
- module System.Process.Typed

# Conduit specific stuff

createSink :: forall (m :: Type -> Type) o. MonadIO m => StreamSpec 'STInput (ConduitM ByteString o m ()) #

Provide input to a process by writing to a conduit. The sink provided here will leave the pipe to the child open after the stream ends. This allows the sink to be used multiple times, but may result in surprising behavior. You may prefer `createSinkClose`, see https://github.com/snoyberg/conduit/issues/434.

Since: 1.2.1

createSinkClose :: forall (m :: Type -> Type) o. MonadIO m => StreamSpec 'STInput (ConduitM ByteString o m ()) #

Like `createSink`, but closes the pipe to the child process as soon as it runs out of data.

Since: 1.3.5

createSource :: forall (m :: Type -> Type) i. MonadIO m => StreamSpec 'STOutput (ConduitM i ByteString m ()) #

Read output from a process by read from a conduit.

Since: 1.2.1

# Running a process with logging

withLoggedProcess_ :: MonadUnliftIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> (Process stdin (ConduitM () ByteString m ()) (ConduitM () ByteString m ()) -> m a) -> m a #

Run a process, throwing an exception on a failure exit code. This will store all output from stdout and stderr in memory for better error messages. Note that this will require unbounded memory usage, so caveat emptor.

This will ignore any previous settings for the stdout and stderr streams, and instead force them to use `createSource`.

Since: 1.2.3

# Reexports

module System.Process.Typed