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

Safe Haskell | None
Language | Haskell98

Data.Conduit.Process.Typed

Contents

- Conduit specific stuff
- Generalized functions
- Reexports

Description

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

Synopsis

- createSink :: MonadIO m => StreamSpec STInput (ConduitM ByteString o m ())
- createSource :: MonadIO m => StreamSpec STOutput (ConduitM i ByteString m ())
- withProcess :: MonadUnliftIO m => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> m a) -> m a
- withProcess_ :: MonadUnliftIO m => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> m a) -> m a
- withLoggedProcess_ :: MonadUnliftIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> (Process stdin (ConduitM () ByteString m ()) (ConduitM () ByteString m ()) -> m a) -> m a
- unsafeProcessHandle :: Process stdin stdout stderr -> ProcessHandle
- getStderr :: Process stdin stdout stderr -> stderr
- getStdout :: Process stdin stdout stderr -> stdout
- getStdin :: Process stdin stdout stderr -> stdin
- checkExitCodeSTM :: Process stdin stdout stderr -> STM ()
- checkExitCode :: MonadIO m => Process stdin stdout stderr -> m ()
- getExitCodeSTM :: Process stdin stdout stderr -> STM (Maybe ExitCode)
- getExitCode :: MonadIO m => Process stdin stdout stderr -> m (Maybe ExitCode)
- waitExitCodeSTM :: Process stdin stdout stderr -> STM ExitCode
- waitExitCode :: MonadIO m => Process stdin stdout stderr -> m ExitCode
- runProcess_ :: MonadIO m => ProcessConfig stdin stdout stderr -> m ()
- runProcess :: MonadIO m => ProcessConfig stdin stdout stderr -> m ExitCode
- readProcessInterleaved_ :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> m ByteString
- readProcessInterleaved :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> m (ExitCode, ByteString)
- readProcessStderr_ :: MonadIO m => ProcessConfig stdin stdout stderrIgnored -> m ByteString
- readProcessStderr :: MonadIO m => ProcessConfig stdin stdout stderrIgnored -> m (ExitCode, ByteString)
- readProcessStdout_ :: MonadIO m => ProcessConfig stdin stdoutIgnored stderr -> m ByteString
- readProcessStdout :: MonadIO m => ProcessConfig stdin stdoutIgnored stderr -> m (ExitCode, ByteString)
- readProcess_ :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> m (ByteString, ByteString)
- readProcess :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> m (ExitCode, ByteString, ByteString)
- withProcessWait_ :: ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> IO a) -> IO a
- withProcessTerm_ :: ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> IO a) -> IO a
- withProcessWait :: ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> IO a) -> IO a
- withProcessTerm :: ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> IO a) -> IO a
- stopProcess :: MonadIO m => Process stdin stdout stderr -> m ()
- startProcess :: MonadIO m => ProcessConfig stdin stdout stderr -> m (Process stdin stdout stderr)
- useHandleClose :: Handle -> StreamSpec anyStreamType ()
- useHandleOpen :: Handle -> StreamSpec anyStreamType ()
- createPipe :: StreamSpec anyStreamType Handle
- byteStringOutput :: StreamSpec STOutput (STM ByteString)
- byteStringInput :: ByteString -> StreamSpec STInput ()
- closed :: StreamSpec anyStreamType ()
- nullStream :: StreamSpec anyStreamType ()
- inherit :: StreamSpec anyStreamType ()
- mkStreamSpec :: StdStream -> (ProcessConfig () () () -> Maybe Handle -> IO (a, IO ())) -> StreamSpec streamType a
- setChildUserInherit :: ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setChildUser :: UserID -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setChildGroupInherit :: ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setChildGroup :: GroupID -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setNewSession :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setCreateNewConsole :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setDetachConsole :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setDelegateCtlc :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setCreateGroup :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setCloseFds :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setEnvInherit :: ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setEnv :: [(String, String)] -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setWorkingDirInherit :: ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setWorkingDir :: FilePath -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
- setStderr :: StreamSpec STOutput stderr -> ProcessConfig stdin stdout stderr0 -> ProcessConfig stdin stdout stderr
- setStdout :: StreamSpec STOutput stdout -> ProcessConfig stdin stdout0 stderr -> ProcessConfig stdin stdout stderr
- setStdin :: StreamSpec STInput stdin -> ProcessConfig stdin0 stdout stderr -> ProcessConfig stdin stdout stderr
- shell :: String -> ProcessConfig () () ()
- proc :: FilePath -> [String] -> ProcessConfig () () ()
- data ProcessConfig stdin stdout stderr
- data StreamType
  - = STInput
  - | STOutput
- data StreamSpec (streamType :: StreamType) a
- data Process stdin stdout stderr
- data ExitCodeException = ExitCodeException {
  - eceExitCode :: ExitCode
  - eceProcessConfig :: ProcessConfig () () ()
  - eceStdout :: ByteString
  - eceStderr :: ByteString
  }
- data ByteStringOutputException = ByteStringOutputException SomeException (ProcessConfig () () ())

# Conduit specific stuff

createSink :: MonadIO m => StreamSpec STInput (ConduitM ByteString o m ()) Source #

Provide input to a process by writing to a conduit.

Since: 1.2.1

createSource :: MonadIO m => StreamSpec STOutput (ConduitM i ByteString m ()) Source #

Read output from a process by read from a conduit.

Since: 1.2.1

# Generalized functions

withProcess :: MonadUnliftIO m => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> m a) -> m a Source #

Same as `withProcess`, but generalized to `MonadUnliftIO`.

Since: 1.2.1

withProcess_ :: MonadUnliftIO m => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> m a) -> m a Source #

Same as `withProcess_`, but generalized to `MonadUnliftIO`.

Since: 1.2.1

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

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

unsafeProcessHandle :: Process stdin stdout stderr -> ProcessHandle Source #

Take `ProcessHandle` out of the `Process`. This method is needed in cases one need to use low level functions from the `process` package. Use cases for this method are:

1. Send a special signal to the process.
2. Terminate the process group instead of terminating single process.
3. Use platform specific API on the underlying process.

This method is considered unsafe because the actions it performs on the underlying process may overlap with the functionality that `typed-process` provides. For example the user should not call `waitForProcess` on the process handle as eiter `waitForProcess` or `stopProcess` will lock. Additionally, even if process was terminated by the `terminateProcess` or by sending signal, `stopProcess` should be called either way in order to cleanup resources allocated by the `typed-process`.

Since: typed-process-0.1.1

getStderr :: Process stdin stdout stderr -> stderr Source #

Get the child's standard error stream value.

Since: typed-process-0.1.0.0

getStdout :: Process stdin stdout stderr -> stdout Source #

Get the child's standard output stream value.

Since: typed-process-0.1.0.0

getStdin :: Process stdin stdout stderr -> stdin Source #

Get the child's standard input stream value.

Since: typed-process-0.1.0.0

checkExitCodeSTM :: Process stdin stdout stderr -> STM () Source #

Same as `checkExitCode`, but in `STM`.

Since: typed-process-0.1.0.0

checkExitCode :: MonadIO m => Process stdin stdout stderr -> m () Source #

Wait for a process to exit, and ensure that it exited successfully. If not, throws an `ExitCodeException`.

Exceptions thrown by this function will not include stdout or stderr (This prevents unbounded memory usage from reading them into memory). However, some callers such as `readProcess_` catch the exception, add the stdout and stderr, and rethrow.

Since: typed-process-0.1.0.0

getExitCodeSTM :: Process stdin stdout stderr -> STM (Maybe ExitCode) Source #

Same as `getExitCode`, but in `STM`.

Since: typed-process-0.1.0.0

getExitCode :: MonadIO m => Process stdin stdout stderr -> m (Maybe ExitCode) Source #

Check if a process has exited and, if so, return its `ExitCode`.

Since: typed-process-0.1.0.0

waitExitCodeSTM :: Process stdin stdout stderr -> STM ExitCode Source #

Same as `waitExitCode`, but in `STM`.

Since: typed-process-0.1.0.0

waitExitCode :: MonadIO m => Process stdin stdout stderr -> m ExitCode Source #

Wait for the process to exit and then return its `ExitCode`.

Since: typed-process-0.1.0.0

runProcess_ :: MonadIO m => ProcessConfig stdin stdout stderr -> m () Source #

Same as `runProcess`, but instead of returning the `ExitCode`, checks it with `checkExitCode`.

Since: typed-process-0.1.0.0

runProcess :: MonadIO m => ProcessConfig stdin stdout stderr -> m ExitCode Source #

Run the given process, wait for it to exit, and returns its `ExitCode`.

Since: typed-process-0.1.0.0

readProcessInterleaved_ :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> m ByteString Source #

Same as `readProcessInterleaved`, but instead of returning the `ExitCode`, checks it with `checkExitCode`.

Exceptions thrown by this function will include stdout.

Since: typed-process-0.2.4.0

readProcessInterleaved :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> m (ExitCode, ByteString) Source #

Same as `readProcess`, but interleaves stderr with stdout.

Motivation: Use this function if you need stdout interleaved with stderr output (e.g. from an HTTP server) in order to debug failures.

Since: typed-process-0.2.4.0

readProcessStderr_ :: MonadIO m => ProcessConfig stdin stdout stderrIgnored -> m ByteString Source #

Same as `readProcessStderr`, but instead of returning the `ExitCode`, checks it with `checkExitCode`.

Exceptions thrown by this function will include stderr.

Since: typed-process-0.2.1.0

readProcessStderr :: MonadIO m => ProcessConfig stdin stdout stderrIgnored -> m (ExitCode, ByteString) Source #

Same as `readProcess`, but only read the stderr of the process. Original settings for stdout remain.

Since: typed-process-0.2.1.0

readProcessStdout_ :: MonadIO m => ProcessConfig stdin stdoutIgnored stderr -> m ByteString Source #

Same as `readProcessStdout`, but instead of returning the `ExitCode`, checks it with `checkExitCode`.

Exceptions thrown by this function will include stdout.

Since: typed-process-0.2.1.0

readProcessStdout :: MonadIO m => ProcessConfig stdin stdoutIgnored stderr -> m (ExitCode, ByteString) Source #

Same as `readProcess`, but only read the stdout of the process. Original settings for stderr remain.

Since: typed-process-0.2.1.0

readProcess_ :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> m (ByteString, ByteString) Source #

Same as `readProcess`, but instead of returning the `ExitCode`, checks it with `checkExitCode`.

Exceptions thrown by this function will include stdout and stderr.

Since: typed-process-0.1.0.0

readProcess :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> m (ExitCode, ByteString, ByteString) Source #

Run a process, capture its standard output and error as a `ByteString`, wait for it to complete, and then return its exit code, output, and error.

Note that any previously used `setStdout` or `setStderr` will be overridden.

Since: typed-process-0.1.0.0

withProcessWait_ :: ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> IO a) -> IO a Source #

Same as `withProcessWait`, but also calls `checkExitCode`

Since: typed-process-0.2.5.0

withProcessTerm_ :: ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> IO a) -> IO a Source #

Same as `withProcessTerm`, but also calls `checkExitCode`

Since: typed-process-0.2.5.0

withProcessWait :: ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> IO a) -> IO a Source #

Uses the bracket pattern to call `startProcess`. Unlike `withProcessTerm`, this function will wait for the child process to exit, and only kill it with `stopProcess` in the event that the inner function throws an exception.

Since: typed-process-0.2.5.0

withProcessTerm :: ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> IO a) -> IO a Source #

Uses the bracket pattern to call `startProcess` and ensures that `stopProcess` is called.

This function is usually not what you want. You're likely better off using `withProcessWait`. See https://github.com/fpco/typed-process/issues/25.

Since: typed-process-0.2.5.0

stopProcess :: MonadIO m => Process stdin stdout stderr -> m () Source #

Close a process and release any resources acquired. This will ensure `terminateProcess` is called, wait for the process to actually exit, and then close out resources allocated for the streams. In the event of any cleanup exceptions being thrown this will throw an exception.

Since: typed-process-0.1.0.0

startProcess :: MonadIO m => ProcessConfig stdin stdout stderr -> m (Process stdin stdout stderr) Source #

Launch a process based on the given `ProcessConfig`. You should ensure that you close `stopProcess` on the result. It's usually better to use one of the functions in this module which ensures `stopProcess` is called, such as `withProcess`.

Since: typed-process-0.1.0.0

useHandleClose :: Handle -> StreamSpec anyStreamType () Source #

Use the provided `Handle` for the child process, and when the process exits, close it. If you have no reason to keep the `Handle` open, you should use this over `useHandleOpen`.

Since: typed-process-0.1.0.0

useHandleOpen :: Handle -> StreamSpec anyStreamType () Source #

Use the provided `Handle` for the child process, and when the process exits, do not close it. This is useful if, for example, you want to have multiple processes write to the same log file sequentially.

Since: typed-process-0.1.0.0

createPipe :: StreamSpec anyStreamType Handle Source #

Create a new pipe between this process and the child, and return a `Handle` to communicate with the child.

Since: typed-process-0.1.0.0

byteStringOutput :: StreamSpec STOutput (STM ByteString) Source #

Capture the output of a process in a `ByteString`.

This function will fork a separate thread to consume all input from the process, and will only make the results available when the underlying `Handle` is closed. As this is provided as an `STM` action, you can either check if the result is available, or block until it's ready.

In the event of any exception occurring when reading from the `Handle`, the `STM` action will throw a `ByteStringOutputException`.

Since: typed-process-0.1.0.0

byteStringInput :: ByteString -> StreamSpec STInput () Source #

An input stream spec which sets the input to the given `ByteString`. A separate thread will be forked to write the contents to the child process.

Since: typed-process-0.1.0.0

closed :: StreamSpec anyStreamType () Source #

A stream spec which will close the stream for the child process. You usually do not want to use this, as it will leave the corresponding file descriptor unassigned and hence available for re-use in the child process. Prefer `nullStream` unless you're certain you want this behavior.

Since: typed-process-0.1.0.0

nullStream :: StreamSpec anyStreamType () Source #

A stream spec which is empty when used for for input and discards output. Note this requires your platform's null device to be available when the process is started.

Since: typed-process-0.2.5.0

inherit :: StreamSpec anyStreamType () Source #

A stream spec which simply inherits the stream of the parent process.

Since: typed-process-0.1.0.0

mkStreamSpec :: StdStream -> (ProcessConfig () () () -> Maybe Handle -> IO (a, IO ())) -> StreamSpec streamType a Source #

Create a new `StreamSpec` from the given `StdStream` and a helper function. This function:

- Takes as input the raw `Maybe Handle` returned by the `createProcess` function. This will be determined by the `StdStream` argument.
- Returns the actual stream value `a`, as well as a cleanup
- function to be run when calling `stopProcess`.

Since: typed-process-0.1.0.0

setChildUserInherit :: ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Inherit the user from the parent process.

Since: typed-process-0.2.2.0

setChildUser :: UserID -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Set the child process's user ID with the POSIX `setuid` syscall, does nothing on non-POSIX. See `child_user`.

Default: False

Since: typed-process-0.1.0.0

setChildGroupInherit :: ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Inherit the group from the parent process.

Since: typed-process-0.2.2.0

setChildGroup :: GroupID -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Set the child process's group ID with the POSIX `setgid` syscall, does nothing on non-POSIX. See `child_group`.

Default: False

Since: typed-process-0.1.0.0

setNewSession :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Set a new session with the POSIX `setsid` syscall, does nothing on non-POSIX. See `new_session`.

Default: False

Since: typed-process-0.1.0.0

setCreateNewConsole :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Create new console on Windows, see `create_new_console`.

Default: False

Since: typed-process-0.1.0.0

setDetachConsole :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Detach console on Windows, see `detach_console`.

Default: False

Since: typed-process-0.1.0.0

setDelegateCtlc :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Delegate handling of Ctrl-C to the child. For more information, see `delegate_ctlc`.

Default: False

Since: typed-process-0.1.0.0

setCreateGroup :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Should we create a new process group?

Default: False

Since: typed-process-0.1.0.0

setCloseFds :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Should we close all file descriptors besides stdin, stdout, and stderr? See `close_fds` for more information.

Default: False

Since: typed-process-0.1.0.0

setEnvInherit :: ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Inherit the environment variables from the parent process.

Since: typed-process-0.2.2.0

setEnv :: [(String, String)] -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Set the environment variables of the child process.

Default: current process's environment.

Since: typed-process-0.1.0.0

setWorkingDirInherit :: ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Inherit the working directory from the parent process.

Since: typed-process-0.2.2.0

setWorkingDir :: FilePath -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr Source #

Set the working directory of the child process.

Default: current process's working directory.

Since: typed-process-0.1.0.0

setStderr :: StreamSpec STOutput stderr -> ProcessConfig stdin stdout stderr0 -> ProcessConfig stdin stdout stderr Source #

Set the child's standard error stream to the given `StreamSpec`.

Default: `inherit`

Since: typed-process-0.1.0.0

setStdout :: StreamSpec STOutput stdout -> ProcessConfig stdin stdout0 stderr -> ProcessConfig stdin stdout stderr Source #

Set the child's standard output stream to the given `StreamSpec`.

Default: `inherit`

Since: typed-process-0.1.0.0

setStdin :: StreamSpec STInput stdin -> ProcessConfig stdin0 stdout stderr -> ProcessConfig stdin stdout stderr Source #

Set the child's standard input stream to the given `StreamSpec`.

Default: `inherit`

Since: typed-process-0.1.0.0

shell :: String -> ProcessConfig () () () Source #

Create a `ProcessConfig` from the given shell command.

Since: typed-process-0.1.0.0

proc :: FilePath -> [String] -> ProcessConfig () () () Source #

Create a `ProcessConfig` from the given command and arguments.

Since: typed-process-0.1.0.0

data ProcessConfig stdin stdout stderr Source #

An abstract configuration for a process, which can then be launched into an actual running `Process`. Takes three type parameters, providing the types of standard input, standard output, and standard error, respectively.

There are three ways to construct a value of this type:

- With the `proc` smart constructor, which takes a command name and a list of arguments.
- With the `shell` smart constructor, which takes a shell string
- With the `IsString` instance via OverloadedStrings. If you provide it a string with no spaces (e.g., `"date"`), it will treat it as a raw command with no arguments (e.g., `proc "date" []`). If it has spaces, it will use `shell`.

In all cases, the default for all three streams is to inherit the streams from the parent process. For other settings, see the setters below for default values.

Since: typed-process-0.1.0.0

Instances

Show (ProcessConfig stdin stdout stderr) |
Instance details Defined in System.Process.Typed Methods showsPrec :: Int -> ProcessConfig stdin stdout stderr -> ShowS Source # show :: ProcessConfig stdin stdout stderr -> String Source # showList :: [ProcessConfig stdin stdout stderr] -> ShowS Source #
(stdin ~ (), stdout ~ (), stderr ~ ()) => IsString (ProcessConfig stdin stdout stderr) |
Instance details Defined in System.Process.Typed Methods fromString :: String -> ProcessConfig stdin stdout stderr Source #

data StreamType Source #

Whether a stream is an input stream or output stream. Note that this is from the perspective of the child process, so that a child's standard input stream is an `STInput`, even though the parent process will be writing to it.

Since: typed-process-0.1.0.0

Constructors

STInput |
STOutput |

data StreamSpec (streamType :: StreamType) a Source #

A specification for how to create one of the three standard child streams. See examples below.

Since: typed-process-0.1.0.0

Instances

Functor (StreamSpec streamType) |
Instance details Defined in System.Process.Typed Methods fmap :: (a -> b) -> StreamSpec streamType a -> StreamSpec streamType b Source # (<$) :: a -> StreamSpec streamType b -> StreamSpec streamType a Source #
(streamType ~ STInput, res ~ ()) => IsString (StreamSpec streamType res) | This instance uses `byteStringInput` to convert a raw string into a stream of input for a child process. Since: typed-process-0.1.0.0
Instance details Defined in System.Process.Typed Methods fromString :: String -> StreamSpec streamType res Source #

data Process stdin stdout stderr Source #

A running process. The three type parameters provide the type of the standard input, standard output, and standard error streams.

Since: typed-process-0.1.0.0

Instances

Show (Process stdin stdout stderr) |
Instance details Defined in System.Process.Typed Methods showsPrec :: Int -> Process stdin stdout stderr -> ShowS Source # show :: Process stdin stdout stderr -> String Source # showList :: [Process stdin stdout stderr] -> ShowS Source #

data ExitCodeException Source #

Exception thrown by `checkExitCode` in the event of a non-success exit code. Note that `checkExitCode` is called by other functions as well, like `runProcess_` or `readProcess_`.

Note that several functions that throw an `ExitCodeException` intentionally do not populate `eceStdout` or `eceStderr`. This prevents unbounded memory usage for large stdout and stderrs.

Since: typed-process-0.1.0.0

Constructors

ExitCodeException |

Fields

- eceExitCode :: ExitCode
- eceProcessConfig :: ProcessConfig () () ()
- eceStdout :: ByteString
- eceStderr :: ByteString

Instances

Show ExitCodeException |
Instance details Defined in System.Process.Typed Methods showsPrec :: Int -> ExitCodeException -> ShowS Source # show :: ExitCodeException -> String Source # showList :: [ExitCodeException] -> ShowS Source #
Exception ExitCodeException |
Instance details Defined in System.Process.Typed Methods toException :: ExitCodeException -> SomeException Source # fromException :: SomeException -> Maybe ExitCodeException Source # displayException :: ExitCodeException -> String Source #

data ByteStringOutputException Source #

Wrapper for when an exception is thrown when reading from a child process, used by `byteStringOutput`.

Since: typed-process-0.1.0.0

Constructors

ByteStringOutputException SomeException (ProcessConfig () () ()) |

Instances

Show ByteStringOutputException |
Instance details Defined in System.Process.Typed Methods showsPrec :: Int -> ByteStringOutputException -> ShowS Source # show :: ByteStringOutputException -> String Source # showList :: [ByteStringOutputException] -> ShowS Source #
Exception ByteStringOutputException |
Instance details Defined in System.Process.Typed Methods toException :: ByteStringOutputException -> SomeException Source # fromException :: SomeException -> Maybe ByteStringOutputException Source # displayException :: ByteStringOutputException -> String Source #