@@ -86,38 +86,38 @@ inFilteredTrav deeper = traverseElems trav
88 :: (Monad m, Foldable g, DomTraversable f)
88 :: (Monad m, Foldable g, DomTraversable f)
89− => Text
89+ => Name -- ^ Name of tag to traverse in
90 -> DomParserT Identity m a
90 -> DomParserT Identity m a
91 -> DomParserT g m (f a)
91 -> DomParserT g m (f a)
92inElemTrav n = inFilteredTrav deeper
92inElemTrav n = inFilteredTrav deeper
94− deeper = (DomPath [n],) . toListOf (folded . nodes . folded . _Element . ell n)
94+ deeper = (DomPath [n],) . toListOf (folded . nodes . folded . _Element . el n)
96-- | Runs parser inside first children element with given name
96-- | Runs parser inside first children element with given name
98 :: (Monad m, Foldable g)
98 :: (Monad m, Foldable g)
100 -> DomParserT Identity m a
100 -> DomParserT Identity m a
101 -> DomParserT g m a
101 -> DomParserT g m a
102inElem n = fmap runIdentity . inElemTrav n
102inElem n = fmap runIdentity . inElemTrav n
105 :: (Monad m, Foldable g)
105 :: (Monad m, Foldable g)
107 -> DomParserT Identity m a
107 -> DomParserT Identity m a
108 -> DomParserT g m [a]
108 -> DomParserT g m [a]
109inElemAll = inElemTrav
109inElemAll = inElemTrav
112 :: (Monad m, Foldable g)
112 :: (Monad m, Foldable g)
114 -> DomParserT Identity m a
114 -> DomParserT Identity m a
115 -> DomParserT g m (Maybe a)
115 -> DomParserT g m (Maybe a)
116inElemMay = inElemTrav
116inElemMay = inElemTrav
119 :: (Monad m, Foldable g)
119 :: (Monad m, Foldable g)
121 -> DomParserT Identity m a
121 -> DomParserT Identity m a
122 -> DomParserT g m (NonEmpty a)
122 -> DomParserT g m (NonEmpty a)
123inElemNe = inElemTrav
123inElemNe = inElemTrav
@@ -159,11 +159,11 @@ divePath path = magnify $ to modElems
159 . over pdPath (<> path)
159 . over pdPath (<> path)
160 diver :: Fold Element Element
160 diver :: Fold Element Element
161 diver = foldr (.) id $ map toDive $ unDomPath path
161 diver = foldr (.) id $ map toDive $ unDomPath path
162− toDive n = nodes . folded . _Element . ell n
162+ toDive n = nodes . folded . _Element . el n
165 :: (Monad m, Foldable g)
165 :: (Monad m, Foldable g)
167 -> DomParserT [] m a
167 -> DomParserT [] m a
168 -> DomParserT g m a
168 -> DomParserT g m a
169diveElem p = divePath $ DomPath [p]
169diveElem p = divePath $ DomPath [p]
@@ -211,15 +211,15 @@ ignoreBlank = ignoreElem test
211-- | Returns name of current element.
211-- | Returns name of current element.
213-- @since 1.0.0
213-- @since 1.0.0
214−getCurrentName :: (Monad m) => DomParserT Identity m Text
214+getCurrentName :: (Monad m) => DomParserT Identity m Name
215−getCurrentName = view $ pdElements . to runIdentity . localName
215+getCurrentName = view $ pdElements . to runIdentity . name
217-- | If name of current tag differs from first argument throws 'PENotFound' with
217-- | If name of current tag differs from first argument throws 'PENotFound' with
218-- tag name replaced in last path's segment. Useful for checking root
218-- tag name replaced in last path's segment. Useful for checking root
219-- document's element name.
219-- document's element name.
220checkCurrentName
220checkCurrentName
221 :: (Monad m)
221 :: (Monad m)
223 -> DomParserT Identity m ()
223 -> DomParserT Identity m ()
224checkCurrentName n = do
224checkCurrentName n = do
225 cn <- getCurrentName
225 cn <- getCurrentName
@@ -294,18 +294,16 @@ getCurrentAttributes = view $ pdElements . to runIdentity . attrs
294-- | Returns element with given name or 'Nothing'
294-- | Returns element with given name or 'Nothing'
296-- @since 1.0.0
296-- @since 1.0.0
297−getCurrentAttribute :: (Monad m) => Text -> DomParserT Identity m (Maybe Text)
297+getCurrentAttribute :: (Monad m) => Name -> DomParserT Identity m (Maybe Text)
298−getCurrentAttribute attrName'
298+getCurrentAttribute attrName
299 = preview $ pdElements . to runIdentity . attr attrName
299 = preview $ pdElements . to runIdentity . attr attrName
301− attrName = Name attrName' Nothing Nothing
303-- | Parses attribute with given name, throws error if attribute is not found.
301-- | Parses attribute with given name, throws error if attribute is not found.
305-- @since 1.0.0
303-- @since 1.0.0
306parseAttribute
304parseAttribute
307 :: (Monad m)
305 :: (Monad m)
309 -- ^ Attribute name
307 -- ^ Attribute name
310 -> (Text -> Either Text a)
308 -> (Text -> Either Text a)
311 -- ^ Attribute content parser
309 -- ^ Attribute content parser
@@ -320,7 +318,7 @@ parseAttribute attrName parser =
320-- @since 1.0.0
318-- @since 1.0.0
321parseAttributeMaybe
319parseAttributeMaybe
322 :: (Monad m)
320 :: (Monad m)
324 -- ^ Attribute name
322 -- ^ Attribute name
325 -> (Text -> Either Text a)
323 -> (Text -> Either Text a)
326 -- ^ Attribute content parser
324 -- ^ Attribute content parser