dir-traverse 0.2.2.1 → 0.2.2.2
raw patch · 3 files changed
+9/−7 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +1/−1
- dir-traverse.cabal +1/−1
- src/System/Directory/Recursive.hs +7/−5
CHANGELOG.md view
@@ -1,6 +1,6 @@ # dir-traverse -## 0.2.2.1+## 0.2.2.2 * Bugfix
dir-traverse.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: dir-traverse-version: 0.2.2.1+version: 0.2.2.2 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2019 Vanessa McHale
src/System/Directory/Recursive.hs view
@@ -13,22 +13,24 @@ -- | @since 0.2.1.0 getSubdirsRecursive :: FilePath -> IO [FilePath]-getSubdirsRecursive = getDirFiltered (const (pure True))+getSubdirsRecursive = getDirFiltered doesDirectoryExist getDirRecursive :: FilePath -> IO [FilePath]-getDirRecursive = getDirFiltered doesDirectoryExist+getDirRecursive = getDirFiltered (const (pure True)) {-# INLINE getDirFiltered #-} -- | @since 0.2.2.0-getDirFiltered :: (FilePath -> IO Bool) -> FilePath -> IO [FilePath]+getDirFiltered :: (FilePath -> IO Bool) -- ^ Filepath filter+ -> FilePath+ -> IO [FilePath] getDirFiltered p fp = do all' <- listDirectory fp- all'' <- fmap mkRel <$> filterM p all'+ all'' <- filterM p (mkRel <$> all') dirs <- filterM doesDirectoryExist all'' case dirs of [] -> pure all'' ds -> do- next <- foldMapA getDirRecursive ds+ next <- foldMapA (getDirFiltered p) ds pure $ all'' ++ next where mkRel = (fp </>)