packages feed

hw-uri 0.1.1.7 → 0.1.1.8

raw patch · 2 files changed

+15/−10 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

hw-uri.cabal view
@@ -1,7 +1,7 @@ cabal-version:          2.4  name:                   hw-uri-version:                0.1.1.7+version:                0.1.1.8 synopsis:               Supports IO on URIs description:            Supports IO on URIs. homepage:               https://github.com/haskell-works/hw-uri
src/HaskellWorks/Data/Uri/IO/File.hs view
@@ -40,16 +40,21 @@   qs <- fmap concat $ IO.interleaveSequenceM $ fmap (recurse filePath) ps   let rs = if filePath /= "." then fmap (filePath </>) qs else qs   return rs+  where go :: (MonadIO m, MonadUnliftIO m) => FilePath -> FilePath -> m [FilePath]+        go filePath dir = do+          ps <- listDirectory filePath+          qs <- fmap concat $ IO.interleaveSequenceM $ fmap (recurse filePath) ps+          return (fmap (dir </>) qs) -recurse :: (MonadIO m, MonadUnliftIO m) => FilePath -> FilePath -> m [FilePath]-recurse filePath p = do-  isDirectory <- liftIO $ IO.doesDirectoryExist (filePath </> p)-  if isDirectory-    then case filePath </> p of-      subPath -> if "./" `L.isPrefixOf` subPath-        then listFilesRecursive (drop 2 subPath)-        else listFilesRecursive subPath-    else return [p]+        recurse :: (MonadIO m, MonadUnliftIO m) => FilePath -> FilePath -> m [FilePath]+        recurse filePath p = do+          isDirectory <- liftIO $ IO.doesDirectoryExist (filePath </> p)+          if isDirectory+            then case filePath </> p of+              subPath -> if "./" `L.isPrefixOf` subPath+                then go (drop 2 subPath) p+                else go subPath p+            else return [p]  listFilesRecursiveWithPrefix :: (MonadIO m, MonadUnliftIO m) => FilePath -> m [FilePath] listFilesRecursiveWithPrefix prefix = if '/' `elem` prefix