Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The utility effect ProcessOutput
takes care of decoding process output, getting called by the
Process
interpreters whenever a chunk was read, while accumulating chunks until they were decoded
successfully.
Synopsis
- data ProcessOutput (p :: OutputPipe) a :: Effect where
- Chunk :: ByteString -> ByteString -> ProcessOutput p a m ([a], ByteString)
- interpretProcessOutputId :: forall p r. InterpreterFor (ProcessOutput p ByteString) r
- interpretProcessOutputLines :: forall p r. InterpreterFor (ProcessOutput p ByteString) r
- interpretProcessOutputText :: forall p r. InterpreterFor (ProcessOutput p Text) r
- interpretProcessOutputTextLines :: forall p r. InterpreterFor (ProcessOutput p Text) r
Documentation
data ProcessOutput (p :: OutputPipe) a :: Effect where Source #
This effect is used by the effect Process
to accumulate and decode chunks of ByteString
s, for
example using a parser.
The interpreter may be stateful or stateless, since the constructor Chunk
is expected to be called with both the
accumulated unprocessed output as well as the new chunk.
Chunk | Add a chunk of output to the accumulator, returning any number of successfully parsed values and the leftover output. |
|
Instances
type DefiningModule ProcessOutput Source # | |
Defined in Polysemy.Process.Effect.ProcessOutput |
interpretProcessOutputId :: forall p r. InterpreterFor (ProcessOutput p ByteString) r Source #
Interpret ProcessOutput
by immediately emitting raw ByteString
s without accumulation.
interpretProcessOutputLines :: forall p r. InterpreterFor (ProcessOutput p ByteString) r Source #
Interpret ProcessOutput
by emitting individual ByteString
lines of output.
interpretProcessOutputText :: forall p r. InterpreterFor (ProcessOutput p Text) r Source #
Interpret ProcessOutput
by immediately emitting Text
without accumulation.
interpretProcessOutputTextLines :: forall p r. InterpreterFor (ProcessOutput p Text) r Source #
Interpret ProcessOutput
by emitting individual Text
lines of output.