polysoup-0.6.4: Online XML parsing with polyparse and tagsoup

Safe HaskellSafe
LanguageHaskell98

Text.XML.PolySoup.Predicate

Description

A generic extracting predicate.

Synopsis

Documentation

newtype Q a b Source #

A predicate checks if the given element satisfies some properties and extracts its attribute values. You can compose predicates using Functor, Applicative and Alternative operators: *>, <*, <|> etc. Note, that it doesn't really have sense to use function like many or some, since the extracting predicate doesn't consume any input.

Constructors

Q 

Fields

Instances
Functor (Q a) Source # 
Instance details

Defined in Text.XML.PolySoup.Predicate

Methods

fmap :: (a0 -> b) -> Q a a0 -> Q a b #

(<$) :: a0 -> Q a b -> Q a a0 #

Applicative (Q a) Source # 
Instance details

Defined in Text.XML.PolySoup.Predicate

Methods

pure :: a0 -> Q a a0 #

(<*>) :: Q a (a0 -> b) -> Q a a0 -> Q a b #

liftA2 :: (a0 -> b -> c) -> Q a a0 -> Q a b -> Q a c #

(*>) :: Q a a0 -> Q a b -> Q a b #

(<*) :: Q a a0 -> Q a b -> Q a a0 #

Alternative (Q a) Source # 
Instance details

Defined in Text.XML.PolySoup.Predicate

Methods

empty :: Q a a0 #

(<|>) :: Q a a0 -> Q a a0 -> Q a a0 #

some :: Q a a0 -> Q a [a0] #

many :: Q a a0 -> Q a [a0] #

true :: Q a a Source #

Predicate which is always satisfied.

satisfy :: (a -> Bool) -> Q a a Source #

Check if the given predicate is satisfied.