Îõ³h$`Ä     !(c) 2020 Composewell Technologies Apache-2.0streamly@composewell.com experimentalGHCNone?ÙQ streamly-process1An exception that is raised when a process fails.streamly-processThe exit code of the process.streamly-process6Process configuration used for creating a new process.äBy default the process config is setup to inherit the following attributes from the parent process:Current working directory EnvironmentOpen file descriptors Process groupProcess uid and gidSignal handlersTerminal (Session)streamly-processprocessBytes' path args input runs the executable at path using args as arguments and inputÔ stream as its standard input. The error stream of the executable is presented as 6 values in the resulting stream and output stream as  values.Raises  exception in case of failure.>For example, the following is equivalent to the shell command ,echo "hello world" | tr [:lower:] [:upper:]::{2 processBytes' "echo" ["hello world"] Stream.nil & Stream.rights0 & processBytes' "tr" ["[:lower:]", "[:upper:]"] & Stream.rights & Stream.fold Stdio.write :} HELLO WORLDstreamly-processprocessChunks file args input runs the executable file& specified by its name or path using args as arguments and inputÛ stream as its standard input. Returns the standard output of the executable as a stream.§If only the name of an executable file is specified instead of its path then the file name is searched in the directories specified by the PATH environment variable.¼If the input stream throws an exception or if the output stream is garbage collected before it could finish then the process is sent a SIGTERM and we wait for it to terminate gracefully.;If the process terminates with a non-zero exit code then a  exception is raised.6The following code is equivalent to the shell command $echo "hello world" | tr [a-z] [A-Z]::{* Process.toChunks "echo" ["hello world"]0 & Process.processChunks "tr" ["[a-z]", "[A-Z]"] & Stream.fold Stdio.writeChunks :} HELLO WORLDstreamly-processLike Ê except that it works on a stream of bytes instead of a stream of chunks.We can write the example in 7 as follows. Notice how seamlessly we can replace the tr process with the Haskell toUpper function::{) Process.toBytes "echo" ["hello world"]Ã & Unicode.decodeLatin1 & Stream.map toUpper & Unicode.encodeLatin1 & Stream.fold Stdio.write :} HELLO WORLD streamly-processtoBytes' path args runs the executable at path using args' as arguments and returns a stream of  bytes. The  values are from stderr and the  values are from stdout of the executable.Raises  exception in case of failure.The following example uses echo to write hello to stdout and world to stderr, then uses folds from Streamly.Console.Stdio to write them back to stdout and stderr respectively::{È Process.toBytes' "/bin/bash" ["-c", "echo 'hello'; echo 'world' 1>&2"]9& Stream.fold (Fold.partition Stdio.writeErr Stdio.write):}worldhello((),())?toBytes' path args = Process.processBytes' path args Stream.nil streamly-processSee .   is defined as:5toBytes path args = processBytes path args Stream.nil6The following code is equivalent to the shell command echo "hello world"::{) Process.toBytes "echo" ["hello world"] & Stream.fold Stdio.write :} hello world streamly-processLike   but generates a stream of  Array Word8 instead of a stream of Word8.:{< toChunks' "bash" ["-c", "echo 'hello'; echo 'world' 1>&2"]Å& Stream.fold (Fold.partition Stdio.writeErrChunks Stdio.writeChunks):}worldhello((),())9toChunks' path args = processChunks' path args Stream.nilPrefer   over   when performance matters. streamly-processSee .   is defined as:7toChunks path args = processChunks path args Stream.nil6The following code is equivalent to the shell command echo "hello world"::{* Process.toChunks "echo" ["hello world"] & Stream.fold Stdio.writeChunks :} hello world streamly-processConfig modifierstreamly-processExecutable name or pathstreamly-process Argumentsstreamly-process Input streamstreamly-process Output streamstreamly-processExecutable name or pathstreamly-process Argumentsstreamly-process Input streamstreamly-process Output streamstreamly-processExecutable name or pathstreamly-process Argumentsstreamly-process Input Streamstreamly-process Output Streamstreamly-processConfig modifierstreamly-processExecutable name or pathstreamly-process Argumentsstreamly-process Input streamstreamly-process Output streamstreamly-processExecutable name or pathstreamly-process Argumentsstreamly-process Input streamstreamly-process Output streamstreamly-processExecutable name or pathstreamly-process Argumentsstreamly-process Input Streamstreamly-process Output Stream streamly-processExecutable name or pathstreamly-process Argumentsstreamly-process Output Stream streamly-processExecutable name or pathstreamly-process Argumentsstreamly-process Output Stream streamly-processExecutable name or pathstreamly-process Argumentsstreamly-process Output Stream streamly-processExecutable name or pathstreamly-process Argumentsstreamly-process Output Stream   !(c) 2020 Composewell Technologies Apache-2.0streamly@composewell.com experimentalGHC Safe-InferredÙ4streamly-process‚Thread safe, mutable process handle. Process status is stored in the handle and is modified by the process inspection operations.streamly-processÂreturn (parent, child, (parentAction, childAction, failureAction))streamly-processáCreates a new process, executes the specified action in the cloned process and then performs an exec™ system call using the provided path, arguments and environment. The PATH is searched for the specified binary when the specified path is not absolute?streamly-processØWait until the process exits by itself or gets terminated due to a signal. Returns the 5 which includes the termination reason or exit code. Thread safe.streamly-process'Get the current status of a process. A . value means the process is still running, a Ï value means the process is terminated and provides the status of the process. Thread safe.streamly-processExecute after fork, before execstreamly-processExecutable pathstreamly-process Argumentsstreamly-process Environment!(c) 2020 Composewell Technologies Apache-2.0streamly@composewell.com experimentalGHCNone´        !"#$%$&'-streamly-process-0.1.0-3XQ5qomimLFEMcAWnCWqDL Streamly.Internal.System.Process&Streamly.Internal.System.Process.PosixStreamly.System.ProcessProcessFailureConfigprocessChunks'WithprocessChunks' processBytes'processChunksWith processChunks processBytestoBytes'toBytes toChunks'toChunks$fExceptionProcessFailure$fShowProcessFailureProcessmkPipe mkStdioPipes newProcesswait getStatus$fExceptionProcessDoesNotExist$fShowProcessDoesNotExist$fShowDirection $fEqDirectionbase Data.EitherLeftRightEither unix-2.7.2.2System.Posix.Process.Internals ProcessStatus GHC.MaybeNothingJust