-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Lenses for the hexml package
--   
--   Lenses for the hexml package
@package hexml-lens
@version 0.2.1

module Main
main :: IO ()

module Text.XML.Hexml.Lens

-- | Getter for the element children
_children :: Getter Node [Node]
class XML s

-- | A prism for parsing and unparsing XML.
--   
--   unparsing is provided by <a>outer</a>.
--   
--   <pre>
--   &gt;&gt;&gt; "&lt;?xml version=\"1.0\"?&gt;&lt;foo/&gt;" ^? _XML
--   Just Node "&lt;?xml version=\"1.0\"?&gt;&lt;foo/&gt;"
--   </pre>
--   
--   Nameless nodes are inserted for trees with &gt;1 root.
--   
--   <pre>
--   &gt;&gt;&gt; "&lt;?xml version=\"1.0\"?&gt;&lt;foo/&gt;" ^? _XML.to name
--   Just ""
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; "&lt;?xml version=\"1.0\"?&gt;&lt;foo/&gt;" ^? _XML._children.ix(0)
--   Just Node "&lt;?xml version=\"1.0\"?&gt;"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; "&lt;?xml version=\"1.0\"?&gt;&lt;foo/&gt;" ^? _XML._children.ix(1)
--   Just Node "&lt;foo/&gt;"
--   </pre>
--   
--   If the tree has only 1 root, no nameless nodes are inserted.
--   
--   <pre>
--   &gt;&gt;&gt; "&lt;foo/&gt;" ^? _XML.re(_XML @String)._XML.to name
--   Just "foo"
--   </pre>
--   
--   The law <tt>x ^? re _XML . _XML == x</tt> doesn't hold for the
--   nameless nodes injected by <a>parse</a>.
--   
--   <pre>
--   &gt;&gt;&gt; parse "&lt;foo/&gt;" ^? _Right.to name
--   Just ""
--   
--   &gt;&gt;&gt; parse "&lt;foo/&gt;" ^? _Right.re(_XML @String)._XML.to name
--   Just "foo"
--   </pre>
_XML :: XML s => Prism' s Node

-- | Fold over all the children (text and element)
_contents :: XML s => Fold Node (Either s Node)

-- | Getter for the <a>inner</a> contents of a node
_inner :: XML s => Getter Node s

-- | Getter for the <a>inner</a> contents of a node
_outer :: XML s => Getter Node s

-- | Fold for accessing the text contents of a node
textContents :: XML s => Fold Node s

-- | Fold for accessing attributes by name.
_Attribute :: XML s => s -> Getter Node (Maybe s)

-- | Name-Indexed fold over the attribute values
iattributes :: XML s => IndexedFold String Node s

-- | A getter for accessing named children nodes This is a more efficient
--   version of
--   
--   <pre>
--   nodes foo = _children . to (filter (\n -&gt; name n == foo))
--   </pre>
nodes :: XML s => s -> Getter Node [Node]

-- | <pre>
--   node n = nodes n . folded
--   </pre>
node :: XML s => s -> Fold Node Node
multiple :: Getting [a] s a -> IndexPreservingGetter s [a]
instance Text.XML.Hexml.Lens.XML GHC.Base.String
instance Text.XML.Hexml.Lens.XML Basement.UTF8.Base.String
instance Text.XML.Hexml.Lens.XML Data.Text.Internal.Text
instance Text.XML.Hexml.Lens.XML Data.Text.Internal.Lazy.Text
instance Text.XML.Hexml.Lens.XML Data.ByteString.Internal.ByteString
instance Text.XML.Hexml.Lens.XML Data.ByteString.Lazy.Internal.ByteString
