Data.Conduit.Process

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

Safe Haskell | None
Language | Haskell98

Data.Conduit.Process

Contents

- Functions
- Reexport

Description

A full tutorial for this module is available on FP School of Haskell: https://www.fpcomplete.com/user/snoyberg/library-documentation/data-conduit-process.

Note that this is a very thin layer around the `Data.Streaming.Process` module. In particular, it:

- Provides orphan instances for conduit
- Provides some useful helper functions

Synopsis

- sourceCmdWithConsumer :: MonadIO m => String -> Consumer ByteString m a -> m (ExitCode, a)
- sourceProcessWithConsumer :: MonadIO m => CreateProcess -> Consumer ByteString m a -> m (ExitCode, a)
- withCheckedProcessCleanup :: (InputSource stdin, OutputSink stderr, OutputSink stdout, MonadIO m, MonadMask m) => CreateProcess -> (stdin -> stdout -> stderr -> m b) -> m b
- module Data.Streaming.Process

# Functions

sourceCmdWithConsumer :: MonadIO m => String -> Consumer ByteString m a -> m (ExitCode, a)

Like `sourceProcessWithConsumer` but providing the command to be run as a `String`.

Since 1.1.2

sourceProcessWithConsumer :: MonadIO m => CreateProcess -> Consumer ByteString m a -> m (ExitCode, a)

Given a `CreateProcess`, run the process, with its output being used as a `Source` to feed the provided `Consumer`. Once the process has completed, return a tuple of the `ExitCode` from the process and the output collected from the `Consumer`.

Since 1.1.2

withCheckedProcessCleanup :: (InputSource stdin, OutputSink stderr, OutputSink stdout, MonadIO m, MonadMask m) => CreateProcess -> (stdin -> stdout -> stderr -> m b) -> m b

Same as `withCheckedProcess`, but kills the child process in the case of an exception being thrown by the provided callback function.

# Reexport

module Data.Streaming.Process