Safe Haskell | None |
---|

- data Chunk a
- = ProcessHandle ProcessHandle
- | Stdout a
- | Stderr a
- | Exception IOError
- | Result ExitCode

- readProcessChunks :: ListLikePlus a c => CreateProcess -> a -> IO [Chunk a]
- foldChunk :: (ProcessHandle -> b) -> (a -> b) -> (a -> b) -> (IOError -> b) -> (ExitCode -> b) -> Chunk a -> b
- foldChunks :: (r -> Chunk a -> r) -> r -> [Chunk a] -> r
- putChunk :: ListLikePlus a c => Chunk a -> IO ()
- canonicalChunks :: ListLikePlus a c => [Chunk a] -> [Chunk a]
- indentChunks :: (ListLikePlus a c, Eq c) => c -> a -> a -> [Chunk a] -> [Chunk a]
- putIndented :: (ListLikePlus a c, Eq c) => c -> a -> a -> [Chunk a] -> IO [Chunk a]
- dotifyChunk :: forall a c m. (Monad m, Functor m, ListLikePlus a c) => Int -> c -> Chunk a -> StateT Int m [Chunk a]
- dotifyChunks :: forall a c. ListLikePlus a c => Int -> c -> [Chunk a] -> [Chunk a]
- putDots :: ListLikePlus a c => Int -> c -> [Chunk a] -> IO [Chunk a]

# Documentation

The output stream of a process returned by `readProcessChunks`

.

ProcessHandle ProcessHandle | This will always come first |

Stdout a | |

Stderr a | |

Exception IOError | |

Result ExitCode |

readProcessChunks :: ListLikePlus a c => CreateProcess -> a -> IO [Chunk a]Source

A concrete use of `readProcessInterleaved`

- build a list
containing chunks of process output, any exceptions that get thrown
(unimplemented), and finally an exit code.

# Control

foldChunk :: (ProcessHandle -> b) -> (a -> b) -> (a -> b) -> (IOError -> b) -> (ExitCode -> b) -> Chunk a -> bSource

foldChunks :: (r -> Chunk a -> r) -> r -> [Chunk a] -> rSource

Build a value from a chunk stream.

putChunk :: ListLikePlus a c => Chunk a -> IO ()Source

Write the Stdout chunks to stdout and the Stderr chunks to stderr.

# Canonical

canonicalChunks :: ListLikePlus a c => [Chunk a] -> [Chunk a]Source

Merge adjacent Stdout or Stderr chunks.

# Indent

indentChunks :: (ListLikePlus a c, Eq c) => c -> a -> a -> [Chunk a] -> [Chunk a]Source

Pure function to indent the text of a chunk list.

putIndented :: (ListLikePlus a c, Eq c) => c -> a -> a -> [Chunk a] -> IO [Chunk a]Source

Output the indented text of a chunk list, but return the original unindented list.

# Dotify

dotifyChunk :: forall a c m. (Monad m, Functor m, ListLikePlus a c) => Int -> c -> Chunk a -> StateT Int m [Chunk a]Source

dotifyChunks :: forall a c. ListLikePlus a c => Int -> c -> [Chunk a] -> [Chunk a]Source