Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | me@jspha.com |
Safe Haskell | None |
A Hexpat lens module for generic tags.
Lenses provide power to do very concise XML tree diving. This module provides a less general interface to the Hexpat datatypes via lenses.
- name :: Traversal' (NodeG f tag text) tag
- attributes :: Traversal' (NodeG f tag text) (Attributes tag text)
- text :: Prism' (NodeG f tag text) text
- children :: Traversal' (NodeG f tag text) (f (NodeG f tag text))
- allNodes :: Traversable c => NodeG c tag text -> [NodeG c tag text]
- (./) :: Plated i => Traversal' s i -> Traversal' i a -> Traversal' s a
- named :: (Choice p, Applicative f, Eq tag) => tag -> Overloaded' p f (NodeG c tag text) (NodeG c tag text)
- parameterized :: (Choice p, Applicative f, Eq tag, Eq text) => tag -> text -> Overloaded' p f (NodeG c tag text) (NodeG c tag text)
Basic inspection
name :: Traversal' (NodeG f tag text) tagSource
attributes :: Traversal' (NodeG f tag text) (Attributes tag text)Source
text :: Prism' (NodeG f tag text) textSource
Prismatic access to the text of a Text
node. This is more
powerful than name
, children
, and attributes
since it can
be Review
ed.
Recursive inspection
children :: Traversal' (NodeG f tag text) (f (NodeG f tag text))Source
allNodes :: Traversable c => NodeG c tag text -> [NodeG c tag text]Source
(./) :: Plated i => Traversal' s i -> Traversal' i a -> Traversal' s aSource
Glue two Traversal
s together as relations. This is much like
XPath
's *slash*.
Filters
named :: (Choice p, Applicative f, Eq tag) => tag -> Overloaded' p f (NodeG c tag text) (NodeG c tag text)Source
Traverses Element
s which have a particular name.
parameterized :: (Choice p, Applicative f, Eq tag, Eq text) => tag -> text -> Overloaded' p f (NodeG c tag text) (NodeG c tag text)Source
parameterized k v
traverses Element
s which match the value
v
at the key k
in their attributes.