process-listlike-0.8: Enhanced version of process-extras

Safe HaskellNone

System.Process.ListLike

Description

Versions of the functions in module Read specialized for type ByteString.

Synopsis

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.

lazy :: a -> BoolSource

length' :: a -> LengthType aSource

toChunks :: a -> [a]Source

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:

  1. The input and outputs can be any instance of ListLikePlus.
  2. Allows you to modify the CreateProcess record before the process starts
  3. Takes a CmdSpec, so you can launch either a RawCommand or a ShellCommand.

readCreateProcessSource

Arguments

:: ListLikePlus a c 
=> CreateProcess

process to run

-> a

standard input

-> IO a

stdout

A polymorphic implementation of readProcess with a few generalizations:

  1. The input and outputs can be any instance of ListLikePlus.
  2. Allows you to modify the CreateProcess record before the process starts
  3. Takes a CmdSpec, so you can launch either a RawCommand or a ShellCommand.

readProcessWithExitCodeSource

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.

readProcessSource

Arguments

:: ListLikePlus a c 
=> FilePath

command to run

-> [String]

any arguments

-> a

standard input

-> IO a

stdout

Implementation of readProcess in terms of readCreateProcess.

data Output a Source

Instances

Eq a => Eq (Output a) 
Show a => Show (Output a)