-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | streamlined html tag parser
--   
--   Tag-stream is a library for parsing HTML//XML to a token stream. It
--   can parse unstructured and malformed HTML from the web. It also
--   provides an Enumeratee which can parse streamline html, which means it
--   consumes constant memory. You can start from the `tests/Tests.hs`
--   module to see what it can do.
@package tagstream-conduit
@version 0.5.6

module Text.HTML.TagStream.Types
type Attr' s = (s, s)
data Token' s
TagOpen :: s -> [Attr' s] -> Bool -> Token' s
TagClose :: s -> Token' s
Text :: s -> Token' s
Comment :: s -> Token' s
Special :: s -> s -> Token' s
Incomplete :: s -> Token' s
data TagType
TagTypeClose :: TagType
TagTypeSpecial :: TagType
TagTypeNormal :: TagType
instance GHC.Show.Show s => GHC.Show.Show (Text.HTML.TagStream.Types.Token' s)
instance GHC.Classes.Eq s => GHC.Classes.Eq (Text.HTML.TagStream.Types.Token' s)
instance GHC.Base.Functor Text.HTML.TagStream.Types.Token'
instance Data.Foldable.Foldable Text.HTML.TagStream.Types.Token'
instance Data.Traversable.Traversable Text.HTML.TagStream.Types.Token'


-- | HTML entity decoding.
module Text.HTML.TagStream.Entities

-- | A decoder.
data Dec builder string
Dec :: (builder -> string) -> ((Char -> Bool) -> string -> (string, string)) -> (string -> builder) -> (Int -> string -> string) -> (string -> Maybe string) -> (string -> Maybe (Char, string)) -> Dec builder string
[decToS] :: Dec builder string -> builder -> string
[decBreak] :: Dec builder string -> (Char -> Bool) -> string -> (string, string)
[decBuilder] :: Dec builder string -> string -> builder
[decDrop] :: Dec builder string -> Int -> string -> string
[decEntity] :: Dec builder string -> string -> Maybe string
[decUncons] :: Dec builder string -> string -> Maybe (Char, string)

-- | Is the character valid in a Name?
isNameChar :: Char -> Bool

-- | Is the character a valid Name starter?
isNameStart :: Char -> Bool

-- | A conduit to decode entities from a stream of tokens into a new stream
--   of tokens.
decodeEntities :: (Monad m, Monoid builder, Monoid string, IsString string, Eq string) => Dec builder string -> Conduit (Token' string) m (Token' string)

module Text.HTML.TagStream

module Text.HTML.TagStream.Utils
splitAccum :: Monoid s => [Token' s] -> (s, [Token' s])

module Text.HTML.TagStream.ByteString
type Token = Token' ByteString
type Attr = Attr' ByteString
quoted :: Char -> Parser ByteString
quotedOr :: Parser ByteString -> Parser ByteString
attrValue :: Parser ByteString
attrName :: Parser ByteString
tagEnd :: Parser Bool
attr :: Parser Attr
attrs :: Parser ([Attr], Bool)
comment :: Parser Token
special :: Parser Token
tag :: Parser Token
incomplete :: Parser Token
text :: Parser Token

-- | Decode the HTML entities e.g. <tt>&amp;amp;</tt> in some text into
--   <tt>&amp;</tt>.
decodeEntitiesBS :: Monad m => Conduit Token m Token
token :: Parser Token
tillScriptEnd :: Token -> Parser [Token]
html :: Parser [Token]
decode :: ByteString -> Either String [Token]
atLeast :: Int -> Parser ByteString -> Parser ByteString
cond :: a -> a -> Bool -> a
(||.) :: Applicative f => f Bool -> f Bool -> f Bool
in2 :: Eq a => (a, a) -> a -> Bool
in3 :: Eq a => (a, a, a) -> a -> Bool
boolP :: Parser a -> Parser Bool
maybeP :: Parser a -> Parser (Maybe a)
cc :: [ByteString] -> Builder
showToken :: (ByteString -> ByteString) -> Token -> Builder
tokenStream :: MonadFail m => Conduit ByteString m Token

module Text.HTML.TagStream.Text
type Token = Token' Text
type Attr = Attr' Text
quoted :: Char -> Parser Text
quotedOr :: Parser Text -> Parser Text
attrValue :: Parser Text
attrName :: Parser Text
tagEnd :: Parser Bool
attr :: Parser Attr
attrs :: Parser ([Attr], Bool)
comment :: Parser Token
special :: Parser Token
tag :: Parser Token
incomplete :: Parser Token
text :: Parser Token

-- | Decode the HTML entities e.g. <tt>&amp;amp;</tt> in some text into
--   <tt>&amp;</tt>.
decodeEntitiesText :: Monad m => Conduit Token m Token
token :: Parser Token
tillScriptEnd :: Token -> Parser [Token]
html :: Parser [Token]
decode :: Text -> Either String [Token]
atLeast :: Int -> Parser Text -> Parser Text
cond :: a -> a -> Bool -> a
(||.) :: Applicative f => f Bool -> f Bool -> f Bool
in2 :: Eq a => (a, a) -> a -> Bool
in3 :: Eq a => (a, a, a) -> a -> Bool
boolP :: Parser a -> Parser Bool
maybeP :: Parser a -> Parser (Maybe a)
cc :: [Text] -> Builder
showToken :: (Text -> Text) -> Token -> Builder
tokenStream :: MonadFail m => Conduit Text m Token

-- | like <a>tokenStream</a>, but it process <a>ByteString</a> input,
--   decode it according to xml version tag.
--   
--   Only support utf-8 and iso8859 for now.
tokenStreamBS :: (MonadThrow m, MonadFail m) => Conduit ByteString m Token
