hextream-0.2.0.0: Streaming-friendly XML parsers

Safe HaskellNone
LanguageHaskell2010

Data.XML.Parser.High.NameParser

Description

All documentation examples assume the following setup:

:set -XOverloadedStrings
import Data.Attoparsec.ByteString
import Data.XML.Parser.High
Synopsis

Documentation

newtype NameParser a Source #

How to parse tag names.

Constructors

NameParser 
Instances
Monad NameParser Source #

Can be combined with >>=. Qualified name is forwarded without change.

Instance details

Defined in Data.XML.Parser.High.NameParser

Methods

(>>=) :: NameParser a -> (a -> NameParser b) -> NameParser b #

(>>) :: NameParser a -> NameParser b -> NameParser b #

return :: a -> NameParser a #

fail :: String -> NameParser a #

Functor NameParser Source # 
Instance details

Defined in Data.XML.Parser.High.NameParser

Methods

fmap :: (a -> b) -> NameParser a -> NameParser b #

(<$) :: a -> NameParser b -> NameParser a #

MonadFail NameParser Source # 
Instance details

Defined in Data.XML.Parser.High.NameParser

Methods

fail :: String -> NameParser a #

Applicative NameParser Source # 
Instance details

Defined in Data.XML.Parser.High.NameParser

Methods

pure :: a -> NameParser a #

(<*>) :: NameParser (a -> b) -> NameParser a -> NameParser b #

liftA2 :: (a -> b -> c) -> NameParser a -> NameParser b -> NameParser c #

(*>) :: NameParser a -> NameParser b -> NameParser b #

(<*) :: NameParser a -> NameParser b -> NameParser a #

Alternative NameParser Source #

Can be combined with <|>

Instance details

Defined in Data.XML.Parser.High.NameParser

a ~ () => IsString (NameParser a) Source #

Match a single QName in a concise way.

>>> parseOnly (runTokenParser $ tag' "foo" anyAttr anyContent) "<foo></foo>"
Right ()
Instance details

Defined in Data.XML.Parser.High.NameParser

Methods

fromString :: String -> NameParser a #

anyName :: NameParser QName Source #

Match any qualified name.

anyNameExcept :: QName -> NameParser QName Source #

Match any qualified name, except for the given value.

>>> parseOnly (runTokenParser $ tag' (anyNameExcept "foo") anyAttr anyContent) "<foo></foo>"
Left ...
>>> parseOnly (runTokenParser $ tag' (anyNameExcept "foo") anyAttr anyContent) "<bar></bar>"
Right ()