zenacy-html-2.0.0: A standard compliant HTML parsing library

Safe HaskellNone
LanguageHaskell2010

Zenacy.HTML.Internal.Query

Description

A basic query facility.

Synopsis

Documentation

data HTMLQuery a Source #

Defines the type for a query.

Instances
Monad HTMLQuery Source # 
Instance details

Defined in Zenacy.HTML.Internal.Query

Methods

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

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

return :: a -> HTMLQuery a #

fail :: String -> HTMLQuery a #

Functor HTMLQuery Source # 
Instance details

Defined in Zenacy.HTML.Internal.Query

Methods

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

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

Applicative HTMLQuery Source # 
Instance details

Defined in Zenacy.HTML.Internal.Query

Methods

pure :: a -> HTMLQuery a #

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

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

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

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

htmlQueryRun :: HTMLNode -> HTMLQuery a -> Maybe a Source #

Runs a query and returns a result.

htmlQueryExec :: HTMLQuery a -> HTMLNode -> Maybe a Source #

Same as run with the arguments flipped.

htmlQueryTry :: HTMLQuery HTMLNode -> HTMLNode -> HTMLNode Source #

Same as run with the arguments flipped.

htmlQueryStop :: HTMLQuery a Source #

Returns a result that stops the query.

htmlQueryCont :: HTMLQuery () Source #

Returns a result that continues the query.

htmlQuerySucc :: a -> HTMLQuery a Source #

Returns a successful query result.

htmlQueryZipper :: HTMLQuery HTMLZipper Source #

Gets the current query zipper.

htmlQueryNode :: HTMLQuery HTMLNode Source #

Gets the current query node.

htmlQueryFirst :: HTMLQuery () Source #

Moves the query to the first child node.

htmlQueryLast :: HTMLQuery () Source #

Moves the query to the last child node.

htmlQueryNext :: HTMLQuery () Source #

Moves the query to the next sibling node.

htmlQueryPrev :: HTMLQuery () Source #

Moves the query to the previous sibling node.

htmlQueryUp :: HTMLQuery () Source #

Moves the query to the parent node.

htmlQueryTest :: Bool -> HTMLQuery () Source #

Evaluates a test result and continues the query if true.

htmlQueryName :: Text -> HTMLQuery () Source #

Tests the current element name.

htmlQueryIsFirst :: HTMLQuery () Source #

Tests the current node to see if it is the first sibling.

htmlQueryIsLast :: HTMLQuery () Source #

Tests the current node to see if it is the last sibling.

htmlQuerySave :: Int -> HTMLQuery () Source #

Saves the current query state.

htmlQueryGet :: Int -> HTMLQuery HTMLNode Source #

Gets a saved query node.

htmlQueryGetZipper :: Int -> HTMLQuery HTMLZipper Source #

Gets a saved query zipper.

htmlQuerySrc :: HTMLQuery HTMLNode Source #

Gets the source input node.

htmlQueryAttr :: Text -> HTMLQuery () Source #

Tests if the current node has an attribute.

htmlQueryAttrVal :: Text -> Text -> HTMLQuery () Source #

Tests if the current node has an attribute value.

htmlQueryId :: Text -> HTMLQuery () Source #

Tests if the current node has an id.

htmlQueryHasClass :: Text -> HTMLQuery () Source #

Tests if the current node has a class.

htmlQueryOnly :: Text -> HTMLQuery () Source #

Moves to the child and require that it is the only child.