process-extras-0.7.4: Process extras

Safe HaskellNone
LanguageHaskell2010

System.Process.Common

Contents

Synopsis

Documentation

class ProcessMaker a where #

Minimal complete definition

process, showProcessMakerForUser

Instances
ProcessMaker CreateProcess #

This is the usual maker argument to readCreateProcessLazy.

Instance details

Defined in System.Process.Common

ProcessMaker (CreateProcess, BufferMode, BufferMode) #

Passing this to readCreateProcessLazy 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.

Instance details

Defined in System.Process.Common

class ListLikeIO text char => ListLikeProcessIO text char where #

Process IO is based on the ListLikeIO class from the ListLike package

Minimal complete definition

forceOutput, readChunks

Methods

forceOutput :: text -> IO text #

readChunks :: Handle -> IO [text] #

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

Instances
ListLikeProcessIO String Char #

Like readProcessWithExitCode that takes a CreateProcess.

Instance details

Defined in System.Process.ListLike

ListLikeProcessIO Chars Char #

Like readProcessWithExitCode, but specialized for Text

Instance details

Defined in System.Process.Chars

ListLikeProcessIO ByteString Word8 #

Like readProcessWithExitCode, but using ByteString

Instance details

Defined in System.Process.ByteString.Lazy

ListLikeProcessIO ByteString Word8 #

Like readProcessWithExitCode, but using ByteString

Instance details

Defined in System.Process.ByteString

ListLikeProcessIO Builder Char #

Like readProcessWithExitCode, but using Text

Instance details

Defined in System.Process.Text.Builder

ListLikeProcessIO Text Char #

Like readProcessWithExitCode, but using Text

Instance details

Defined in System.Process.Text.Lazy

ListLikeProcessIO Text Char #

Like readProcessWithExitCode, but using Text

Instance details

Defined in System.Process.Text

class (IsString text, Monoid text, ListLike text char) => ProcessText text char #

Instances
ProcessText String Char # 
Instance details

Defined in System.Process.ListLike

ProcessText ByteString Word8 # 
Instance details

Defined in System.Process.ByteString.Lazy

ProcessText ByteString Word8 # 
Instance details

Defined in System.Process.ByteString

ProcessText Text Char # 
Instance details

Defined in System.Process.Text.Lazy

ProcessText Text Char # 
Instance details

Defined in System.Process.Text

class Monoid result => ProcessResult text result | result -> text where #

Minimal complete definition

pidf, outf, errf, intf, codef

Methods

pidf :: ProcessHandle -> result #

outf :: text -> result #

errf :: text -> result #

intf :: SomeException -> result #

codef :: ExitCode -> result #

Instances
ListLikeProcessIO a c => ProcessResult a [Chunk a] # 
Instance details

Defined in System.Process.ListLike

Methods

pidf :: ProcessHandle -> [Chunk a] #

outf :: a -> [Chunk a] #

errf :: a -> [Chunk a] #

intf :: SomeException -> [Chunk a] #

codef :: ExitCode -> [Chunk a] #

ListLikeProcessIO a c => ProcessResult a (ExitCode, [Chunk a]) # 
Instance details

Defined in System.Process.ListLike

Methods

pidf :: ProcessHandle -> (ExitCode, [Chunk a]) #

outf :: a -> (ExitCode, [Chunk a]) #

errf :: a -> (ExitCode, [Chunk a]) #

intf :: SomeException -> (ExitCode, [Chunk a]) #

codef :: ExitCode -> (ExitCode, [Chunk a]) #

ListLikeProcessIO text char => ProcessResult text (ExitCode, text, text) # 
Instance details

Defined in System.Process.Common

Methods

pidf :: ProcessHandle -> (ExitCode, text, text) #

outf :: text -> (ExitCode, text, text) #

errf :: text -> (ExitCode, text, text) #

intf :: SomeException -> (ExitCode, text, text) #

codef :: ExitCode -> (ExitCode, text, text) #

readProcessWithExitCode #

Arguments

:: ListLikeProcessIO text char 
=> FilePath

command to run

-> [String]

any arguments

-> text

standard input

-> IO (ExitCode, text, text)

exitcode, stdout, stderr

Like readProcessWithExitCode, but with generalized input and output type. Aside from the usual text-like types, the output can be a list of Chunk a. This lets you process the chunks received from stdout and stderr lazil, in the order they are received, as well as the exit code. Utilities to handle Chunks are provided in System.Process.ListLike.

readCreateProcessWithExitCode #

Arguments

:: (ProcessMaker maker, ListLikeProcessIO text char) 
=> maker

command and arguments to run

-> text

standard input

-> IO (ExitCode, text, text)

exitcode, stdout, stderr

readCreateProcessStrict :: (ProcessMaker maker, ProcessResult text result, ListLikeProcessIO text char) => maker -> text -> IO result #

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

Like readCreateProcessStrict, but the output is read lazily.

showCreateProcessForUser :: CreateProcess -> String #

System.Process utility functions.

Orphan instances

Semigroup ExitCode # 
Instance details

Monoid ExitCode #

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

Instance details