hexpat-lens-0.0.4: Lenses for Hexpat.

Portabilitynon-portable
Stabilityexperimental
Maintainerme@jspha.com
Safe HaskellNone

Text.XML.Expat.Lens.Unqualified

Description

A simple Hexpat lens module.

Lenses provide power to do very concise XML tree diving. This module provides a less general interface to the Hexpat datatypes via lenses.

Synopsis

Documentation

name :: Traversal' (UNode t) tSource

Traverses the name of an Element. This is as an Affine, or 0-or-1 target, Traversal. In regex terms, you can think of it like the ? suffix modifier.

attributes :: Traversal' (UNode t) (UAttributes t)Source

Traverses to the list of attributes of an Element. This is as an Affine, or 0-or-1 target, Traversal. In regex terms, you can think of it like the ? suffix modifier.

children :: Traversal' (UNode t) [UNode t]Source

Traverses the children of an Element. This is as an Affine, or 0-or-1 target, Traversal. In regex terms, you can think of it like the ? suffix modifier.

text :: Prism' (UNode t) tSource

Prismatic access to the text of a Text node. This is more powerful than name, children, and attributes since it can be Reviewed.

allNodes :: UNode t -> [UNode t]Source

Produces a list of all UNodes in a XML tree. Synonym for universe.

named :: (Choice p, Applicative f, Eq t) => t -> Overloaded' p f (UNode t) (UNode t)Source

Traverses Elements which have a particular name.

parameterized :: (Choice p, Applicative f, Eq t, GenericXMLString t) => t -> t -> Overloaded' p f (UNode t) (UNode t)Source

parameterized k v traverses Elements which match the value v at the key k in their attributes.