| Safe Haskell | None |
|---|
System.Process.ListLike
Description
Versions of the functions in module Read specialized for type ByteString.
- class (Integral (LengthType a), ListLikeIO a c) => ListLikePlus a c where
- type LengthType a
- binary :: a -> [Handle] -> IO ()
- lazy :: a -> Bool
- length' :: a -> LengthType a
- toChunks :: a -> [a]
- readProcessInterleaved :: (ListLikePlus a c, Monoid b) => (ExitCode -> b) -> (a -> b) -> (a -> b) -> CreateProcess -> a -> IO b
- readInterleaved :: forall a b c. (ListLikePlus a c, Monoid b) => [(a -> b, Handle)] -> IO b -> IO b
- readCreateProcessWithExitCode :: forall a c. ListLikePlus a c => CreateProcess -> a -> IO (ExitCode, a, a)
- readCreateProcess :: ListLikePlus a c => CreateProcess -> a -> IO a
- readProcessWithExitCode :: ListLikePlus a c => FilePath -> [String] -> a -> IO (ExitCode, a, a)
- readProcess :: ListLikePlus a c => FilePath -> [String] -> a -> IO a
- data Output a
- readProcessChunks :: ListLikePlus a c => CreateProcess -> a -> IO [Output a]
Documentation
class (Integral (LengthType a), ListLikeIO a c) => ListLikePlus a c whereSource
Class of types which can be used as the input and outputs of the process functions.
Associated Types
type LengthType a Source
Methods
binary :: a -> [Handle] -> IO ()Source
This should call hSetBinaryMode on each handle if a is a
ByteString type, so that it doesn't attempt to decode the text
using the current locale.
length' :: a -> LengthType aSource
readProcessInterleaved :: (ListLikePlus a c, Monoid b) => (ExitCode -> b) -> (a -> b) -> (a -> b) -> CreateProcess -> a -> IO bSource
A test version of readProcessC Pipes code here: http:hpaste.org/76631
readInterleaved :: forall a b c. (ListLikePlus a c, Monoid b) => [(a -> b, Handle)] -> IO b -> IO bSource
Simultaneously read the output from all the handles, using the associated functions to add them to the Monoid b in the order they appear. Close each handle on EOF (even though they were open when we received them.) I can't think of anything else to do with a handle that has reached EOF.
readCreateProcessWithExitCodeSource
Arguments
| :: forall a c . ListLikePlus a c | |
| => CreateProcess | process to run |
| -> a | standard input |
| -> IO (ExitCode, a, a) | exitcode, stdout, stderr, exception |
A polymorphic implementation of
readProcessWithExitCode with a few
generalizations:
- The input and outputs can be any instance of
ListLikePlus. - Allows you to modify the
CreateProcessrecord before the process starts - Takes a
CmdSpec, so you can launch either aRawCommandor aShellCommand.
Arguments
| :: ListLikePlus a c | |
| => CreateProcess | process to run |
| -> a | standard input |
| -> IO a | stdout |
A polymorphic implementation of readProcess with a few generalizations:
- The input and outputs can be any instance of
ListLikePlus. - Allows you to modify the
CreateProcessrecord before the process starts - Takes a
CmdSpec, so you can launch either aRawCommandor aShellCommand.
Arguments
| :: ListLikePlus a c | |
| => FilePath | command to run |
| -> [String] | any arguments |
| -> a | standard input |
| -> IO (ExitCode, a, a) | exitcode, stdout, stderr |
A polymorphic implementation of
readProcessWithExitCode in terms of
readCreateProcessWithExitCode.
Arguments
| :: ListLikePlus a c | |
| => FilePath | command to run |
| -> [String] | any arguments |
| -> a | standard input |
| -> IO a | stdout |
Implementation of readProcess in terms of
readCreateProcess.
readProcessChunks :: ListLikePlus a c => CreateProcess -> a -> IO [Output a]Source