-- | Parse a stream, returning a result and the rest of the stream.
parseStream
    :: (Functor m, Monad m)
    => Parser a
    -> Producer B.ByteString m r
    -> m (Either P.ParsingError a, Producer B.ByteString m r)
parseStream parser = runStateT $ fmap snd <$> P.parse parser
parseStream
    :: (Functor m, Monad m)
    => Parser a
    -> Producer B.ByteString m r
    -> m (Either P.ParsingError a, Producer B.ByteString m r)
parseStream parser = runStateT $ fmap snd <$> P.parse parser
parseStream parser = runStateT $ fmap snd <$> P.parse parser