find-conduit 0.2.0 → 0.2.1
raw patch · 3 files changed
+9/−11 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/Conduit/Find.hs +3/−4
- Data/Conduit/Find/Looped.hs +5/−6
- find-conduit.cabal +1/−1
Data/Conduit/Find.hs view
@@ -34,7 +34,6 @@ , not_ ) where -import Debug.Trace import Conduit import Control.Applicative import Control.Arrow@@ -97,7 +96,8 @@ -> Producer m FileEntry sourceFileEntries (FileInfo p d) m = sourceDirectory p =$= awaitForever f where- f fp = applyPredicate m (FileInfo (trace ("fp: " ++ show (fp)) $ fp) (trace ("d: " ++ show (d)) $ d)) yield (sourceFileEntries (FileInfo fp (succ d)))+ f fp = applyPredicate m (FileInfo fp d) yield $+ sourceFileEntries (FileInfo fp (succ d)) -- | Return all entries. This is the same as 'sourceDirectoryDeep', except -- that the 'FileStatus' structure for each entry is also provided. As a@@ -229,13 +229,12 @@ where worker d m fp = do let info = FileInfo fp d- r <- lift $ runLooped filt (trace ("pf info: " ++ show (info)) $ info)+ r <- lift $ runLooped filt info let candidate = case r of Ignore -> IgnoreFile Keep _ -> ConsiderFile Recurse _ -> MaybeRecurse KeepAndRecurse _ _ -> ConsiderFile- trace ("candidate: " ++ show (candidate)) $ return () unless (candidate == IgnoreFile) $ do st <- liftIO $ (if follow
Data/Conduit/Find/Looped.hs view
@@ -3,7 +3,6 @@ -- | Main entry point to the application. module Data.Conduit.Find.Looped where -import Debug.Trace import Control.Applicative import Control.Arrow import Control.Category@@ -132,7 +131,7 @@ -> (Looped m a b -> t m ()) -> t m () applyPredicate l x f g = do r <- lift $ runLooped l x- case (trace ("r: " ++ show (r)) $ r) of+ case r of Ignore -> return () Keep a -> f a Recurse m -> g m@@ -193,10 +192,10 @@ prune :: MonadIO m => Looped m a a -> Looped m a a prune (Looped f) = Looped (\a -> go a `liftM` f a) where- go a Ignore = trace ("prune keep") $ Keep a- go _ (Keep _) = trace ("prune drop") $ Ignore- go a (Recurse l) = trace ("prune keepr") $ KeepAndRecurse a (prune l)- go _ (KeepAndRecurse _ _) = trace ("prune drop") $ Ignore+ go a Ignore = Keep a+ go _ (Keep _) = Ignore+ go a (Recurse l) = KeepAndRecurse a (prune l)+ go _ (KeepAndRecurse _ _) = Ignore promote :: Monad m => (a -> m (Maybe b)) -> Looped m a b promote f = Looped $ \a -> do
find-conduit.cabal view
@@ -1,5 +1,5 @@ Name: find-conduit-Version: 0.2.0+Version: 0.2.1 Synopsis: A file-finding conduit that allows user control over traversals. License-file: LICENSE License: MIT