filesystem-conduit 0.2.0.1 → 0.3.0
raw patch · 2 files changed
+10/−13 lines, 2 filesdep ~conduitPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: conduit
API changes (from Hackage documentation)
- Data.Conduit.Filesystem: sinkFile :: ResourceIO m => FilePath -> Sink ByteString m ()
+ Data.Conduit.Filesystem: sinkFile :: MonadResource m => FilePath -> Sink ByteString m ()
- Data.Conduit.Filesystem: sourceFile :: ResourceIO m => FilePath -> Source m ByteString
+ Data.Conduit.Filesystem: sourceFile :: MonadResource m => FilePath -> Source m ByteString
- Data.Conduit.Filesystem: traverse :: ResourceIO m => Bool -> FilePath -> Source m FilePath
+ Data.Conduit.Filesystem: traverse :: MonadIO m => Bool -> FilePath -> Source m FilePath
Files
- Data/Conduit/Filesystem.hs +8/−11
- filesystem-conduit.cabal +2/−2
Data/Conduit/Filesystem.hs view
@@ -38,24 +38,21 @@ -- Note: the option of whether to follow symlinks is currently only checked -- on POSIX platforms, as the @Win32@ package does not support querying -- symlink status. On Windows, symlinks will always be followed.-traverse :: C.ResourceIO m+traverse :: MonadIO m => Bool -- ^ Follow directory symlinks (only used on POSIX platforms) -> FilePath -- ^ Root directory -> C.Source m FilePath-traverse followSymlinks root = C.Source- { C.sourcePull = do- seq0 <- liftIO $ listDirectory root- pull seq0- , C.sourceClose = return ()- }+traverse followSymlinks root = C.SourceM+ (liftIO (listDirectory root) >>= pull)+ (return ()) where- mkSrc ps = C.Source (pull ps) (return ())+ mkSrc ps = C.SourceM (pull ps) (return ()) pull [] = return C.Closed pull (p:ps) = do isFile' <- liftIO $ isFile p if isFile'- then return $ C.Open (mkSrc ps) p+ then return $ C.Open (mkSrc ps) (return ()) p else do follow' <- liftIO $ follow p if follow'@@ -77,13 +74,13 @@ #endif -- | Same as 'CB.sourceFile', but uses system-filepath\'s @FilePath@ type.-sourceFile :: C.ResourceIO m+sourceFile :: C.MonadResource m => FilePath -> C.Source m S.ByteString sourceFile = CB.sourceFile . encodeString -- | Same as 'CB.sinkFile', but uses system-filepath\'s @FilePath@ type.-sinkFile :: C.ResourceIO m+sinkFile :: C.MonadResource m => FilePath -> C.Sink S.ByteString m () sinkFile = CB.sinkFile . encodeString
filesystem-conduit.cabal view
@@ -1,5 +1,5 @@ Name: filesystem-conduit-Version: 0.2.0.1+Version: 0.3.0 Synopsis: Use system-filepath data types with conduits. Description: Provides ability to traverse a folder structure efficiently, as well as convenience wrappers for reading from and writing to files. License: BSD3@@ -21,7 +21,7 @@ , system-filepath >= 0.4.3 && < 0.5 , bytestring >= 0.9 , text >= 0.11- , conduit >= 0.2 && < 0.3+ , conduit >= 0.3 && < 0.4 ghc-options: -Wall if os(windows)