packages feed

dir-traverse 0.2.2.2 → 0.2.2.3

raw patch · 5 files changed

+37/−2 lines, 5 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # dir-traverse +## 0.2.2.3++  * Performance improvements with `unsafeInterleaveIO`+ ## 0.2.2.2    * Bugfix
README.md view
@@ -3,3 +3,5 @@ Get all descendants of a directory. It should have similar performance to [dirstream](http://hackage.haskell.org/package/dirstream), with fewer dependencies.++This streams in memory, like `dirstream`.
dir-traverse.cabal view
@@ -1,6 +1,6 @@ cabal-version:   1.18 name:            dir-traverse-version:         0.2.2.2+version:         0.2.2.3 license:         BSD3 license-file:    LICENSE copyright:       Copyright: (c) 2019 Vanessa McHale@@ -51,6 +51,24 @@         pipes-safe -any,         system-filepath -any,         directory -any++    if impl(ghc >=8.0)+        ghc-options:+            -Wincomplete-uni-patterns -Wincomplete-record-updates+            -Wredundant-constraints -Widentities++    if impl(ghc >=8.4)+        ghc-options: -Wmissing-export-lists++benchmark mem+    type:             exitcode-stdio-1.0+    main-is:          Mem.hs+    hs-source-dirs:   mem+    default-language: Haskell2010+    ghc-options:      -Wall+    build-depends:+        base -any,+        dir-traverse -any      if impl(ghc >=8.0)         ghc-options:
+ mem/Mem.hs view
@@ -0,0 +1,10 @@+module Main ( main ) where++import           System.Directory.Recursive (getDirRecursive)+import           System.Environment         (getArgs)++main :: IO ()+main = force $ getDirRecursive . head =<< getArgs++force :: IO [FilePath] -> IO ()+force x = (\fps -> last fps `seq` mempty) =<< x
src/System/Directory/Recursive.hs view
@@ -9,6 +9,7 @@ import           Data.Traversable    (traverse) import           System.Directory    (doesDirectoryExist, listDirectory) import           System.FilePath     ((</>))+import           System.IO.Unsafe    (unsafeInterleaveIO)   -- | @since 0.2.1.0@@ -30,7 +31,7 @@     case dirs of         [] -> pure all''         ds -> do-            next <- foldMapA (getDirFiltered p) ds+            next <- unsafeInterleaveIO $ foldMapA (getDirFiltered p) ds             pure $ all'' ++ next      where mkRel = (fp </>)