process-extras-0.4.1.3: Process extras

Safe HaskellNone
LanguageHaskell98

System.Process.Common

Contents

Synopsis

Documentation

class ProcessMaker a where Source #

Minimal complete definition

process

Instances

ProcessMaker CreateProcess Source #

This is the usual maker argument to readCreateProcess.

ProcessMaker (CreateProcess, BufferMode, BufferMode) Source #

Passing this to readCreateProcess as the maker argument allows you to set the buffer mode of the process stdout and stderr handles just after the handles are created. These are set to BlockBuffering by default, but for running console commands LineBuffering is probably what you want.

class ListLikeIO a c => ListLikeProcessIO a c where Source #

Minimal complete definition

forceOutput, readChunks

Methods

forceOutput :: a -> IO a Source #

readChunks :: Handle -> IO [a] Source #

Read from a handle, returning a lazy list of the monoid a.

class Monoid b => ProcessOutput a b | b -> a where Source #

Minimal complete definition

pidf, outf, errf, intf, codef

Methods

pidf :: ProcessHandle -> b Source #

outf :: a -> b Source #

errf :: a -> b Source #

intf :: SomeException -> b Source #

codef :: ExitCode -> b Source #

readProcessWithExitCode Source #

Arguments

:: ListLikeProcessIO a c 
=> FilePath

command to run

-> [String]

any arguments

-> a

standard input

-> IO (ExitCode, a, a)

exitcode, stdout, stderr

Like readProcessWithExitCode, but with generalized input and output type.

readCreateProcessWithExitCode Source #

Arguments

:: (ProcessMaker maker, ListLikeProcessIO a c) 
=> maker

command and arguments to run

-> a

standard input

-> IO (ExitCode, a, a)

exitcode, stdout, stderr

readCreateProcess :: (ProcessMaker maker, ProcessOutput a b, ListLikeProcessIO a c) => maker -> a -> IO b Source #

readCreateProcessLazy :: (ProcessMaker maker, ProcessOutput a b, ListLikeProcessIO a c) => maker -> a -> IO b Source #

Like readCreateProcess, but the output is read lazily.

Orphan instances

Monoid ExitCode Source #

A process usually has one ExitCode at the end of its output, this Monoid instance lets us build the type returned by readProcessWithExitCode.