-- 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.2.1.0


-- | This module introduces <a>ConduitParser</a>, a wrapper around
--   <tt>Sink</tt> that behaves like a parser.
--   
--   You probably want to import the <a>Text.Parser.Combinators</a> module
--   together with this module.
module Data.Conduit.Parser

-- | Core type of the package. This is basically a <a>Sink</a> with a
--   parsing state.
data ConduitParser i m a

-- | Run a <a>ConduitParser</a>. Any parsing failure will be thrown as an
--   exception.
runConduitParser :: MonadThrow m => ConduitParser i m a -> ConduitT i Void m a

-- | Flipped version of (<a>&lt;?&gt;</a>).
named :: Monad m => Text -> ConduitParser i m a -> ConduitParser i m a

-- | <a>await</a> wrapped as a <a>ConduitParser</a>.
--   
--   If no data is available, <a>UnexpectedEndOfInput</a> is thrown.
await :: Monad m => ConduitParser i m i

-- | <a>leftover</a> wrapped as a <a>ConduitParser</a>.
leftover :: i -> ConduitParser i m ()

-- | Return the ordered list of names (assigned through (<a>&lt;?&gt;</a>))
--   for the current parser stack. First element is the most nested parser.
getParserNames :: ConduitParser i m [Text]

-- | Return the name (assigned through (<a>&lt;?&gt;</a>)) of the current
--   parser (most nested), or <a>mempty</a> if it has none.
getParserName :: ConduitParser i m Text

-- | <a>peek</a> wrapped as a <a>ConduitParser</a>.
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
