hextream-0.1.0.1: 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 

Fields

Instances
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 #

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 ()