Lastik 0.4 → 0.5
raw patch · 3 files changed
+7/−29 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Lastik.Directory: copyFiles :: RecursePredicate -> FilterPredicate -> FilePath -> FilePath -> IO ()
- Lastik.Util: (>>>>) :: (Applicative f) => f ExitCode -> f ExitCode -> f ExitCode
+ Lastik.Util: (>>>>) :: (Monad m) => m ExitCode -> m ExitCode -> m ExitCode
Files
- Lastik.cabal +1/−1
- Lastik/Directory.hs +1/−24
- Lastik/Util.hs +5/−4
Lastik.cabal view
@@ -1,5 +1,5 @@ Name: Lastik-Version: 0.4+Version: 0.5 License: BSD3 License-File: LICENSE Author: Tony Morris <code@tmorris.net>
Lastik/Directory.hs view
@@ -8,8 +8,7 @@ dropRoot, dropRoot', mkdir,- rmdir,- copyFiles+ rmdir ) where import System.Directory@@ -103,25 +102,3 @@ rmdir :: FilePath -- ^ The directory to remove. -> IO () rmdir d = doesDirectoryExist d >>= flip when (removeDirectoryRecursive d)---- | Copies files from one directory to another directory.-copyFiles :: RecursePredicate -- ^ The recursion predicate to search for files to copy.- -> FilterPredicate -- ^ The filter predicate to search for files to copy.- -> FilePath -- ^ The directory to copy from.- -> FilePath -- ^ The directory to copy to.- -> IO ()-copyFiles r f from to = do isf <- doesFileExist from- if isf- then error ("Cannot copy from file " ++ from)- else do isd <- doesDirectoryExist from- if isd- then do dis <- doesFileExist to- if dis- then error ("Cannot copy to" ++ to ++ " (a file)")- else do j <- find r f from- k <- filterM doesFileExist j- mkdir to- mapM_ (\z -> let t = to </> dropWhile (pathSeparator ==) (drop (length from) z)- in do mkdir (dropFileName t)- copyFile z t) k- else error (from ++ " is not a directory")
Lastik/Util.hs view
@@ -29,10 +29,11 @@ import System.FilePath -- | Applies the second value only if the first produces @ExitSuccess@.-(>>>>) :: (Applicative f) => f ExitCode -> f ExitCode -> f ExitCode-(>>>>) = let ExitSuccess `k` q = q- p `k` _= p- in liftA2 k+(>>>>) :: (Monad m) => m ExitCode -> m ExitCode -> m ExitCode+f >>>> g = do e <- f+ if e == ExitSuccess+ then g+ else return e -- | Executes the second action only if the first produces @ExitSuccess@. (>>>>>) :: (Monad m) => m ExitCode -> m () -> m ()