hierarchy 1.0.1 → 1.0.2
raw patch · 2 files changed
+7/−7 lines, 2 filesdep ~exceptionsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: exceptions
API changes (from Hackage documentation)
Files
- hierarchy.cabal +4/−4
- src/Hierarchy.hs +3/−3
hierarchy.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 2596f3b56ac8cc1f0530263376774a0928ed672af04accda1fdf311d298fb764+-- hash: 7748f3ca1f7405c760d01c22deb293079ce8eb68885b1e66a38b43b171c044eb name: hierarchy-version: 1.0.1+version: 1.0.2 synopsis: Predicated traversal of generated trees description: Predicated traversal of generated trees. category: Data@@ -32,7 +32,7 @@ src build-depends: base >=4.7 && <4.12- , exceptions >=0.8 && <0.9+ , exceptions >=0.10 && <0.12 , free >=4.12 && <6 , mmorph >=1.0 && <1.2 , monad-control >=1.0 && <1.1@@ -56,7 +56,7 @@ base >=4.7 && <4.12 , directory >=1.0 , doctest >=0.8- , exceptions >=0.8 && <0.9+ , exceptions >=0.10 && <0.12 , filepath >=1.3 , free >=4.12 && <6 , mmorph >=1.0 && <1.2
src/Hierarchy.hs view
@@ -8,7 +8,7 @@ import Control.Cond -- | A 'TreeT' is a tree of values, where the (possible) branches are--- 'ListT's over some Monad 'm'.+-- represented by some MonadPlus 'm'. type TreeT m = CofreeT Maybe m -- | Turn a list into a series of possibilities:@@ -21,7 +21,7 @@ descend (CofreeT t) = t >>= \(a :< mp) -> pure (a, mp) {-# INLINE descend #-} --- | Perform a depth-first traversal of a 'TreeT', yielding a 'ListT' of its+-- | Perform a depth-first traversal of a 'TreeT', yielding each of its -- contents. Note that breadth-first traversals cannot offer static memory -- guarantees, so they are not provided by this module. walk :: MonadPlus m => TreeT m a -> m a@@ -44,7 +44,7 @@ -- when (path @`elem@` [".@/@.git", ".@/@dist", ".@/@result"]) -- prune -- ignore these, and don't recurse into them -- guard_ (".hs" @`isInfixOf@`) -- implicitly references 'path'--- runEffect $ for (runListT (walk files)) $ liftIO . print+-- forM_ (walk files) $ liftIO . print -- @ winnow :: MonadPlus m => TreeT m a -> CondT a m () -> TreeT m a winnow (CofreeT t) p = CofreeT $ t >>= \(a :< mst) -> do