-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A parser-agnostic declarative API for querying XML-documents -- -- Provides an API for definitition of destructuring of XML-documents, -- while delegating the actual parsing process to outer APIs. Thus it -- allows the users to implement parser-agnostic XML-parsing -- specifications, with the intent of later interpreting them with -- specific parsers or documentation generators, or what not. -- -- Following are the known interpreters: -- --
@package xml-query @version 0.9.1 -- | An API for the implementation of interpreters. Should only be used by -- the libraries, which implement the interpreters. module XMLQuery.AST data Text a Text :: (Text -> Either Text a) -> Text a data Element a ElementNameText :: (Alt Text a) -> Element a ElementAttr :: (Alt Attr a) -> Element a ElementNodes :: (Alt Nodes a) -> Element a data Attr a AttrNameText :: (Alt Text a) -> Attr a AttrValueText :: (Alt Text a) -> Attr a data Nodes a NodesNode :: (Alt Node a) -> Nodes a data Node a NodeElement :: (Alt Element a) -> Node a NodeText :: (Alt Text a) -> Node a instance GHC.Base.Functor XMLQuery.AST.Text instance GHC.Base.Functor XMLQuery.AST.Element instance GHC.Base.Functor XMLQuery.AST.Attr instance GHC.Base.Functor XMLQuery.AST.Nodes instance GHC.Base.Functor XMLQuery.AST.Node module XMLQuery -- | Parser in the context of a textual value. type Text = Alt Text -- | Lifts an arbitrary textual parser function to the text-value parser. -- -- Provides a doorway for composition with such libraries as "parsec" or -- "attoparsec". text :: (Text -> Either Text a) -> Text a -- | Simply extracts the textual value. textValue :: Text Text type Element = Alt Element elementNameText :: Text a -> Element a -- | Parses one of element's attributes without any regard to order. elementAttr :: Attr a -> Element a -- | Parses all of element's nodes. -- -- Can be used multiple times, thus allowing for parallel parsing of -- element's child-nodes. Naturally this will result in traversing the -- element's nodes multiple times. elementNodes :: Nodes a -> Element a elementNameIs :: Text -> Element () type Attr = Alt Attr -- | Parses the attribute's name using the provided textual parser. attrNameText :: Text a -> Attr a -- | Parses the attribute's value using the provided textual parser. attrValueText :: Text a -> Attr a -- | A parser, which succeeds if the attribute's name matches the provided -- value. attrNameIs :: Text -> Attr () -- | A parser, which succeeds if the attribute's value matches the provided -- value. attrValueIs :: Text -> Attr () -- | A sequential backtracking parser of nodes. type Nodes = Alt Nodes -- | Parses the next node. nodesImmediateNode :: Node a -> Nodes a -- | Parses one of the following nodes. nodesEventualNode :: Node a -> Nodes a type Node = Alt Node nodeElement :: Element a -> Node a nodeText :: Text a -> Node a