packages feed

tagsoup-navigate 0.1.0.3 → 0.1.0.4

raw patch · 3 files changed

+16/−44 lines, 3 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Text.HTML.TagSoup.Navigate.Types.TagTreePosState: breadthFirstFindForest :: (TagTree str -> Bool) -> TagTreePosState str ()
- Text.HTML.TagSoup.Navigate.Types.TagTreePosState: breadthFirstFindForestT :: Monad f => (TagTree str -> f Bool) -> TagTreePosStateT str f ()
- Text.HTML.TagSoup.Navigate.Types.TagTreePosState: depthFirstFindForest :: (TagTree str -> Bool) -> TagTreePosState str ()
- Text.HTML.TagSoup.Navigate.Types.TagTreePosState: depthFirstFindForestT :: Monad f => (TagTree str -> f Bool) -> TagTreePosStateT str f ()
- Text.HTML.TagSoup.Navigate.Types.TagTreePosState: findTree :: ((TagTree str -> Bool) -> TagTreePosState str ()) -> (TagTree str -> Bool) -> TagTreePosState str ()
+ Text.HTML.TagSoup.Navigate.Types.TagTreePosState: findTree :: TagTreePosState str () -> TagTreePosState str () -> (TagTree str -> Bool) -> TagTreePosState str ()
- Text.HTML.TagSoup.Navigate.Types.TagTreePosState: findTreeT :: Monad f => ((TagTree str -> f Bool) -> TagTreePosStateT str f ()) -> (TagTree str -> f Bool) -> TagTreePosStateT str f ()
+ Text.HTML.TagSoup.Navigate.Types.TagTreePosState: findTreeT :: Monad f => TagTreePosStateT str f a -> TagTreePosStateT str f b -> (TagTree str -> f Bool) -> TagTreePosStateT str f ()

Files

changelog.md view
@@ -1,3 +1,7 @@+0.1.0.4++* fix bug in breadth/depth first search.+ 0.1.0.3  * add breadth-first and depth-first search functions.
src/Text/HTML/TagSoup/Navigate/Types/TagTreePosState.hs view
@@ -41,12 +41,8 @@ , findTree , depthFirstFindTreeT , depthFirstFindTree-, depthFirstFindForestT-, depthFirstFindForest , breadthFirstFindTreeT , breadthFirstFindTree-, breadthFirstFindForestT-, breadthFirstFindForest , findContentUntil , findUntil , tagBranchLeafText@@ -363,27 +359,29 @@  findTreeT ::   Monad f =>-  ((TagTree str -> f Bool) -> TagTreePosStateT str f ())+  TagTreePosStateT str f a+  -> TagTreePosStateT str f b   -> (TagTree str -> f Bool)   -> TagTreePosStateT str f ()-findTreeT k pr =+findTreeT s1 s2 pr =   do  c <- liftTagTreePosState content       z <- lift (pr c)-      unless z (liftTagTreePosState firstChild *> k pr)+      unless z ((s1 *> breadthFirstFindTreeT pr) <|> (s2 *> breadthFirstFindTreeT pr))  findTree ::-  ((TagTree str -> Bool) -> TagTreePosState str ())+  TagTreePosState str ()+  -> TagTreePosState str ()   -> (TagTree str -> Bool)   -> TagTreePosState str ()-findTree k pr =-  findTreeT (\z -> k (runIdentity . z)) (Identity . pr)+findTree s1 s2 pr =+  findTreeT s1 s2 (Identity . pr)  depthFirstFindTreeT ::   Monad f =>   (TagTree str -> f Bool)   -> TagTreePosStateT str f () depthFirstFindTreeT =-  findTreeT depthFirstFindForestT+  findTreeT (liftTagTreePosState firstChild) (liftTagTreePosState nextSibling)  depthFirstFindTree ::   (TagTree str -> Bool)@@ -391,48 +389,18 @@ depthFirstFindTree pr =   depthFirstFindTreeT (Identity . pr) -depthFirstFindForestT ::-  Monad f =>-  (TagTree str -> f Bool)-  -> TagTreePosStateT str f ()-depthFirstFindForestT pr =-  do  c <- liftTagTreePosState content-      z <- lift (pr c)-      unless z (depthFirstFindTreeT pr <|> (liftTagTreePosState nextSibling *> depthFirstFindForestT pr))--depthFirstFindForest ::-  (TagTree str -> Bool)-  -> TagTreePosState str ()-depthFirstFindForest pr =-  depthFirstFindForestT (Identity . pr)- breadthFirstFindTreeT ::   Monad f =>   (TagTree str -> f Bool)   -> TagTreePosStateT str f () breadthFirstFindTreeT =-  findTreeT breadthFirstFindForestT-  +  findTreeT (liftTagTreePosState nextSibling) (liftTagTreePosState firstChild)+ breadthFirstFindTree ::   (TagTree str -> Bool)   -> TagTreePosState str () breadthFirstFindTree pr =   breadthFirstFindTreeT (Identity . pr)--breadthFirstFindForestT ::-  Monad f =>-  (TagTree str -> f Bool)-  -> TagTreePosStateT str f ()-breadthFirstFindForestT pr =-  do  c <- liftTagTreePosState content-      z <- lift (pr c)-      unless z ((liftTagTreePosState nextSibling *> breadthFirstFindForestT pr) <|> breadthFirstFindTreeT pr)--breadthFirstFindForest ::-  (TagTree str -> Bool)-  -> TagTreePosState str ()-breadthFirstFindForest pr =-  breadthFirstFindForestT (Identity . pr)  findContentUntil ::   Monad f =>
tagsoup-navigate.cabal view
@@ -1,5 +1,5 @@ name:                 tagsoup-navigate-version:              0.1.0.3+version:              0.1.0.4 synopsis:             Tagsoup Navigate description:          Lenses and data types for navigating tagsoup license:              BSD3