Safe Haskell | None |
---|
Support for using the Chunk
list returned by readProcessChunks
.
- data Chunk a
- = ProcessHandle ProcessHandle
- | Stdout a
- | Stderr a
- | Exception SomeException
- | Result ExitCode
- readCreateProcessChunks :: ListLikeLazyIO a c => CreateProcess -> a -> IO [Chunk a]
- discardEmptyChunks :: ListLikeLazyIO a c => [Chunk a] -> [Chunk a]
- fuseChunks :: ListLikeLazyIO a c => [Chunk a] -> [Chunk a]
- collectProcessTriple :: Monoid a => [Chunk a] -> (ExitCode, a, a)
- collectProcessResult :: Monoid a => [Chunk a] -> (ExitCode, [Chunk a])
- collectProcessOutput :: Monoid a => [Chunk a] -> (ExitCode, a)
- indentChunks :: forall a c. (ListLikeLazyIO a c, Eq c, IsString a) => String -> String -> [Chunk a] -> [Chunk a]
- dotifyChunks :: forall a c. ListLikeLazyIO a c => Int -> c -> [Chunk a] -> [Chunk a]
- putChunk :: ListLikeLazyIO a c => Chunk a -> IO ()
- putMappedChunks :: ListLikeLazyIO a c => ([Chunk a] -> [Chunk a]) -> [Chunk a] -> IO [Chunk a]
- putIndented :: (ListLikeLazyIO a c, Eq c, IsString a) => String -> String -> [Chunk a] -> IO [Chunk a]
- putIndentedShowCommand :: (ListLikeLazyIO a c, Eq c, IsString a) => CreateProcess -> String -> String -> [Chunk a] -> IO [Chunk a]
- putDots :: ListLikeLazyIO a c => Int -> c -> [Chunk a] -> IO [Chunk a]
- putDotsLn :: forall a c. (IsString a, ListLikeLazyIO a c) => Int -> c -> [Chunk a] -> IO [Chunk a]
- insertCommandStart :: (IsString a, ListLikeLazyIO a c, Eq c) => CreateProcess -> [Chunk a] -> [Chunk a]
- insertCommandResult :: (IsString a, ListLikeLazyIO a c, Eq c) => CreateProcess -> [Chunk a] -> [Chunk a]
- insertCommandDisplay :: (IsString a, ListLikeLazyIO a c, Eq c) => CreateProcess -> [Chunk a] -> [Chunk a]
- showCreateProcessForUser :: CreateProcess -> String
- showCmdSpecForUser :: CmdSpec -> String
Documentation
A concrete representation of the methods in ProcessOutput.
ProcessHandle ProcessHandle | This will always come first |
Stdout a | |
Stderr a | |
Exception SomeException | |
Result ExitCode |
ListLikeLazyIO a c => ProcessOutput a [Chunk a] | |
ListLikeLazyIO a c => ProcessOutput a (ExitCode, [Chunk a]) |
readCreateProcessChunks :: ListLikeLazyIO a c => CreateProcess -> a -> IO [Chunk a]Source
A concrete use of readCreateProcess
- build a list containing
chunks of process output, any exceptions that get thrown, and
finally an exit code. If a is a lazy type the returned list will
be lazy.
discardEmptyChunks :: ListLikeLazyIO a c => [Chunk a] -> [Chunk a]Source
Eliminate empty Stdout or Stderr chunks.
fuseChunks :: ListLikeLazyIO a c => [Chunk a] -> [Chunk a]Source
Merge adjacent Stdout or Stderr chunks. This may be undesirable if you want to get your input as soon as it becomes available, it has the effect of making the result less lazy.
collectProcessTriple :: Monoid a => [Chunk a] -> (ExitCode, a, a)Source
collectProcessResult :: Monoid a => [Chunk a] -> (ExitCode, [Chunk a])Source
collectProcessOutput :: Monoid a => [Chunk a] -> (ExitCode, a)Source
indentChunks :: forall a c. (ListLikeLazyIO a c, Eq c, IsString a) => String -> String -> [Chunk a] -> [Chunk a]Source
Pure function to indent the text of a chunk list.
dotifyChunks :: forall a c. ListLikeLazyIO a c => Int -> c -> [Chunk a] -> [Chunk a]Source
putChunk :: ListLikeLazyIO a c => Chunk a -> IO ()Source
Write the Stdout chunks to stdout and the Stderr chunks to stderr.
putMappedChunks :: ListLikeLazyIO a c => ([Chunk a] -> [Chunk a]) -> [Chunk a] -> IO [Chunk a]Source
Apply a function to the chunk list and output the result, return the original (unmodified) chunk list.
putIndented :: (ListLikeLazyIO a c, Eq c, IsString a) => String -> String -> [Chunk a] -> IO [Chunk a]Source
Output the indented text of a chunk list, but return the original unindented list.
putIndentedShowCommand :: (ListLikeLazyIO a c, Eq c, IsString a) => CreateProcess -> String -> String -> [Chunk a] -> IO [Chunk a]Source
putDots :: ListLikeLazyIO a c => Int -> c -> [Chunk a] -> IO [Chunk a]Source
Output the dotified text of a chunk list. Returns the original (undotified) list.
putDotsLn :: forall a c. (IsString a, ListLikeLazyIO a c) => Int -> c -> [Chunk a] -> IO [Chunk a]Source
Output the dotified text of a chunk list with a newline at EOF. Returns the original list.
insertCommandStart :: (IsString a, ListLikeLazyIO a c, Eq c) => CreateProcess -> [Chunk a] -> [Chunk a]Source
Insert a chunk displaying the command and its arguments at the beginning of the chunk list.
insertCommandResult :: (IsString a, ListLikeLazyIO a c, Eq c) => CreateProcess -> [Chunk a] -> [Chunk a]Source
Insert a chunk displaying the command and the result code.
insertCommandDisplay :: (IsString a, ListLikeLazyIO a c, Eq c) => CreateProcess -> [Chunk a] -> [Chunk a]Source
showCreateProcessForUser :: CreateProcess -> StringSource
showCmdSpecForUser :: CmdSpec -> StringSource