Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- interpretProcessOutputIgnore :: forall p a r. InterpreterFor (ProcessOutput p a) r
- interpretProcessOutputId :: forall p r. InterpreterFor (ProcessOutput p ByteString) r
- interpretProcessOutputLeft :: forall p a b r. Member (ProcessOutput p a) r => InterpreterFor (ProcessOutput p (Either a b)) r
- interpretProcessOutputRight :: forall p a b r. Member (ProcessOutput p b) r => InterpreterFor (ProcessOutput p (Either a b)) 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
- parseMany :: Parser a -> Maybe (Parser a) -> ByteString -> (Maybe (Parser a), ([Either Text a], ByteString))
- interpretProcessOutputIncremental :: forall p a r. (ByteString -> ProcessOutputParseResult a) -> InterpreterFor (ProcessOutput p (Either Text a)) r
Documentation
interpretProcessOutputIgnore :: forall p a r. InterpreterFor (ProcessOutput p a) r Source #
Interpret ProcessOutput
by discarding any output.
interpretProcessOutputId :: forall p r. InterpreterFor (ProcessOutput p ByteString) r Source #
Interpret ProcessOutput
by immediately emitting raw ByteString
s without accumulation.
interpretProcessOutputLeft :: forall p a b r. Member (ProcessOutput p a) r => InterpreterFor (ProcessOutput p (Either a b)) r Source #
Transformer for ProcessOutput
that lifts results into Left
, creating 'ProcessOutput p (Either a b)' from
'ProcessOutput p a'.
interpretProcessOutputRight :: forall p a b r. Member (ProcessOutput p b) r => InterpreterFor (ProcessOutput p (Either a b)) r Source #
Transformer for ProcessOutput
that lifts results into Right
, creating 'ProcessOutput p (Either a b)' from
'ProcessOutput p b'.
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.
parseMany :: Parser a -> Maybe (Parser a) -> ByteString -> (Maybe (Parser a), ([Either Text a], ByteString)) Source #
Internal helper for interpretProcessOutputIncremental
that repeatedly parses elements from a chunk until the
parser returns a failure or a partial result.
interpretProcessOutputIncremental :: forall p a r. (ByteString -> ProcessOutputParseResult a) -> InterpreterFor (ProcessOutput p (Either Text a)) r Source #
Whenever a chunk of output arrives, call the supplied incremental parser whose result must be converted to
ProcessOutputParseResult
.
If a partial parse result is produced, it is stored in the state and resumed when the next chunk is available.
If parsing an a
succeeds, the parser recurses until it fails.