hxt-css-0.1.0.3: CSS selectors for HXT

Stabilityprovisional
Safe HaskellSafe
LanguageHaskell2010

Text.XML.HXT.CSS.TypeDefs

Description

Data types for the abstract syntax tree of CSS selectors. We (mostly) follow the naming conventions of the CSS Level 3 specification document (http://www.w3.org/TR/css3-selectors/). The type hierarchy tries to strike a balance between correctness and complexity. As a result, it is possible to construct values that correspond to invalid selectors. For example,

Negation (Negation UniversalSelector)

is not valid according to the spec, as double negation is not allowed. Note that parseCSS never produces invalid selectors.

Synopsis

Documentation

newtype SelectorsGroup #

The top-level selector type.

Constructors

SelectorsGroup [Selector]
E, F

data AttrTest #

Constructors

AttrExists
[attr]
AttrEq String
[attr=var]
AttrContainsSp String
[attr~=var]
AttrBeginHy String
[attr|=var]
AttrPrefix String
[attr^=var]
AttrSuffix String
[attr$=var]
AttrSubstr String
[attr*=var]
Instances
Eq AttrTest # 
Instance details

Defined in Text.XML.HXT.CSS.TypeDefs

Show AttrTest # 
Instance details

Defined in Text.XML.HXT.CSS.TypeDefs

data PseudoClass #

Pseudo classes.

Constructors

PseudoFirstChild
:first-child
PseudoLastChild
:last-child
PseudoOnlyChild
:only-child
PseudoFirstOfType
:first-of-type
PseudoLastOfType
:last-of-type
PseudoOnlyOfType
:only-of-type
PseudoEmpty
:empty
PseudoRoot
:root

data PseudoNthClass #

Pseudo classes that expect a argument of type Nth.

Constructors

PseudoNthChild Nth
:nth-child(..)
PseudoNthLastChild Nth
:nth-last-child(..)
PseudoNthOfType Nth
:nth-of-type(..)
PseudoNthLastOfType Nth
:nth-last-of-type(..)

data Nth #

Type of the argument of the :nth-child (PseudoNthClass) family of pseudo classes. Nth a b matches with all integers that can be written in the form an+b for some nonnegative integer n.

Constructors

Nth Int Int
an+b
Odd
odd
Even
even
Instances
Eq Nth # 
Instance details

Defined in Text.XML.HXT.CSS.TypeDefs

Methods

(==) :: Nth -> Nth -> Bool #

(/=) :: Nth -> Nth -> Bool #

Show Nth # 
Instance details

Defined in Text.XML.HXT.CSS.TypeDefs

Methods

showsPrec :: Int -> Nth -> ShowS #

show :: Nth -> String #

showList :: [Nth] -> ShowS #

findPseudoClass :: String -> Maybe PseudoClass #

Find a PseudoClass given its name (without the colon).

findPseudoNthClass :: String -> Maybe (Nth -> PseudoNthClass) #

Find a PseudoNthClass given its name (without the colon).

testNth :: Nth -> Int -> Bool #

Check whether an integer satisfies a "Diophantine" constraint given in form of a value of type Nth.