Safe Haskell | None |
---|---|
Language | Haskell98 |
Re-export all symbols and instances of the process-extras package. Adds the Chunk type with a ProcessOutput instance, and a collectOutput function to turn a list of chunks into any instance of ProcessOutput, such as (ExitCode, String, String). This means you can have readCreateProcess output a list of Chunk, operate on it to do progress reporting, and finally convert it to the type that readProcessWithExitCode woud have returned.
- class ProcessMaker a where
- class ListLikeIO a c => ListLikeProcessIO a c where
- forceOutput :: a -> IO a
- class Monoid b => ProcessOutput a b | b -> a where
- pidf :: ProcessHandle -> b
- outf :: a -> b
- errf :: a -> b
- intf :: SomeException -> b
- codef :: ExitCode -> b
- readCreateProcess :: (ProcessMaker maker, ProcessOutput a b, ListLikeProcessIO a c) => maker -> a -> IO b
- readCreateProcessLazy :: (ProcessMaker maker, ProcessOutput a b, ListLikeProcessIO a c) => maker -> a -> IO b
- readCreateProcessWithExitCode :: (ProcessMaker maker, ListLikeProcessIO a c) => maker -> a -> IO (ExitCode, a, a)
- readProcessWithExitCode :: ListLikeProcessIO a c => FilePath -> [String] -> a -> IO (ExitCode, a, a)
- data Chunk a
- collectOutput :: ProcessOutput a b => [Chunk a] -> b
- foldOutput :: (ProcessHandle -> r) -> (a -> r) -> (a -> r) -> (SomeException -> r) -> (ExitCode -> r) -> Chunk a -> r
- writeOutput :: ListLikeIO a c => [Chunk a] -> IO ()
- showCreateProcessForUser :: CreateProcess -> String
- showCmdSpecForUser :: CmdSpec -> String
- proc :: FilePath -> [String] -> CreateProcess
- shell :: String -> CreateProcess
Documentation
class ProcessMaker a where Source
ProcessMaker CreateProcess Source | This is the usual maker argument to |
ProcessMaker (CreateProcess, BufferMode, BufferMode) Source | Passing this to |
class ListLikeIO a c => ListLikeProcessIO a c where Source
forceOutput :: a -> IO a Source
class Monoid b => ProcessOutput a b | b -> a where Source
pidf :: ProcessHandle -> b Source
intf :: SomeException -> b Source
ListLikeProcessIO a c => ProcessOutput a [Chunk a] Source | |
ListLikeProcessIO a c => ProcessOutput a (ExitCode, [Chunk a]) Source | |
ListLikeProcessIO a c => ProcessOutput a (ExitCode, a, a) Source |
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.
readCreateProcessWithExitCode Source
:: (ProcessMaker maker, ListLikeProcessIO a c) | |
=> maker | command and arguments to run |
-> a | standard input |
-> IO (ExitCode, a, a) | exitcode, stdout, stderr |
readProcessWithExitCode Source
:: 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.
This type is a concrete representation of the methods of class ProcessOutput. If you take your process output as this type you could, for example, echo all the output and then use collectOutput below to convert it to any other instance of ProcessOutput.
ProcessHandle ProcessHandle | This will always come first, before any output or exit code. |
Stdout a | |
Stderr a | |
Result ExitCode | |
Exception SomeException | Note that the instances below do not use this constructor. |
ListLikeProcessIO a c => ProcessOutput a [Chunk a] Source | |
ListLikeProcessIO a c => ProcessOutput a (ExitCode, [Chunk a]) Source | |
Show a => Show (Chunk a) Source |
collectOutput :: ProcessOutput a b => [Chunk a] -> b Source
Turn a [Chunk a]
into any other instance of ProcessOutput
.
foldOutput :: (ProcessHandle -> r) -> (a -> r) -> (a -> r) -> (SomeException -> r) -> (ExitCode -> r) -> Chunk a -> r Source
writeOutput :: ListLikeIO a c => [Chunk a] -> IO () Source
Send Stdout chunks to stdout and Stderr chunks to stderr.
showCreateProcessForUser :: CreateProcess -> String Source
System.Process utility functions.
proc :: FilePath -> [String] -> CreateProcess
Construct a CreateProcess
record for passing to createProcess
,
representing a raw command with arguments.
See RawCommand
for precise semantics of the specified FilePath
.
shell :: String -> CreateProcess
Construct a CreateProcess
record for passing to createProcess
,
representing a command to be passed to the shell.