-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Parsing framework based on conduit.
--
-- Please refer to README.
@package conduit-parse
@version 0.1.2.2
-- | This module introduces ConduitParser, a wrapper around
-- Sink that behaves like a parser.
--
-- You probably want to import the Text.Parser.Combinators module
-- together with this module.
module Data.Conduit.Parser
-- | Core type of the package. This is basically a Sink with a
-- parsing state.
newtype ConduitParser i m a
ConduitParser :: (ExceptT ConduitParserException (StateT ([Text], Buffer i) (Sink i m)) a) -> ConduitParser i m a
-- | Run a ConduitParser. Any parsing failure will be thrown as an
-- exception.
runConduitParser :: (MonadThrow m) => ConduitParser i m a -> Sink i m a
-- | Flipped version of (<?>).
named :: (Monad m) => Text -> ConduitParser i m a -> ConduitParser i m a
-- | await wrapped as a ConduitParser.
--
-- If no data is available, UnexpectedEndOfInput is thrown.
await :: (Monad m) => ConduitParser i m i
-- | Synonym for await
anyOne :: (Monad m) => ConduitParser i m i
-- | leftover wrapped as a ConduitParser.
leftover :: i -> ConduitParser i m ()
-- | Return the ordered list of names (assigned through (<?>))
-- for the current parser stack. First element is the most nested parser.
getParserNames :: ConduitParser i m [Text]
-- | Return the name (assigned through (<?>)) of the current
-- parser (most nested), or mempty if it has none.
getParserName :: ConduitParser i m Text
-- | peek wrapped as a ConduitParser.
peek :: (Monad m) => ConduitParser i m (Maybe i)
data ConduitParserException
BothFailed :: ConduitParserException -> ConduitParserException -> ConduitParserException
ExpectedEndOfInput :: ConduitParserException
NamedParserException :: Text -> ConduitParserException -> ConduitParserException
UnexpectedEndOfInput :: ConduitParserException
UnexpectedFollowedBy :: Text -> ConduitParserException
Unexpected :: Text -> ConduitParserException
-- | Turn a parser into a regular Conduit that yields parsed items
-- as long as the parser succeeds. Once the parser fails, the conduit
-- stops consuming input and won't yield any more.
parseC :: (MonadThrow m) => ConduitParser i m a -> Conduit i m a
parseOrSkipC :: (MonadThrow m) => ConduitParser i m a -> ConduitParser i m b -> Conduit i m a
lastRequired :: MonadThrow m => Text -> Consumer a m a
lastDef :: MonadThrow m => a -> Consumer a m a
embed :: (MonadCatch m) => Sink i m a -> ConduitParser i m a