extra 1.3 → 1.3.1
raw patch · 7 files changed
+27/−10 lines, 7 filesdep ~basedep ~directoryPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, directory
API changes (from Hackage documentation)
Files
- CHANGES.txt +2/−0
- Generate.hs +1/−1
- README.md +1/−1
- extra.cabal +3/−2
- src/Control/Exception/Extra.hs +1/−1
- src/Control/Monad/Extra.hs +4/−4
- src/System/Directory/Extra.hs +15/−1
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for Extra +1.3.1+ #9, support directory-1.2.3 1.3 Add whenJustM Add errorIO
Generate.hs view
@@ -20,7 +20,7 @@ src <- readFile $ joinPath ("src" : split (== '.') mod) <.> "hs" let funcs = filter validIdentifier $ takeWhile (/= "where") $ words $ replace "," " " $ drop1 $ dropWhile (/= '(') $- unlines $ filter (not . isPrefixOf "--" . trim) $ lines src+ unlines $ filter (\x -> not $ any (`isPrefixOf` trim x) ["--","#"]) $ lines src let tests = mapMaybe (stripPrefix "-- > ") $ lines src return (mod, funcs, tests) writeFileBinaryChanged "src/Extra.hs" $ unlines $
README.md view
@@ -5,7 +5,7 @@ * `Control.Monad.Extra.concatMapM` provides a monadic version of `concatMap`, in the same way that `mapM` is a monadic version of `map`. * `Data.Tuple.Extra.fst3` provides a function to get the first element of a triple. * `Control.Exception.Extra.retry` provides a function that retries an `IO` action a number of times.-* `System.Environment.Extra.lookupEnv` is a functional available in GHC 7.6 and above. On GHC 7.6 and above this package reexports the version from `System.Environment` while on GHC 7.4 and below it defines an equivalent version.+* `System.Environment.Extra.lookupEnv` is a function available in GHC 7.6 and above. On GHC 7.6 and above this package reexports the version from `System.Environment` while on GHC 7.4 and below it defines an equivalent version. The module `Extra` documents all functions provided by this library. Modules such as `Data.List.Extra` provide extra functions over `Data.List` and also reexport `Data.List`. Users are recommended to replace `Data.List` imports with `Data.List.Extra` if they need the extra functionality.
extra.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.10 build-type: Simple name: extra-version: 1.3+version: 1.3.1 license: BSD3 license-file: LICENSE category: Development@@ -17,9 +17,10 @@ bug-reports: https://github.com/ndmitchell/extra/issues tested-with: GHC==7.10.1, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2 -extra-source-files:+extra-doc-files: CHANGES.txt README.md+extra-source-files: Generate.hs source-repository head
src/Control/Exception/Extra.hs view
@@ -115,5 +115,5 @@ tryBool :: Exception e => (e -> Bool) -> IO a -> IO (Either e a) tryBool f a = tryJust (bool f) a -bool :: Exception e => (e -> Bool) -> (e -> Maybe e)+bool :: (e -> Bool) -> (e -> Maybe e) bool f x = if f x then Just x else Nothing
src/Control/Monad/Extra.hs view
@@ -126,7 +126,7 @@ (&&^) :: Monad m => m Bool -> m Bool -> m Bool (&&^) a b = ifM a b (return False) --- | A version of 'any' lifted to a moand. Retains the short-circuiting behaviour.+-- | A version of 'any' lifted to a monad. Retains the short-circuiting behaviour. -- -- > anyM Just [False,True ,undefined] == Just True -- > anyM Just [False,False,undefined] == undefined@@ -135,7 +135,7 @@ anyM p [] = return False anyM p (x:xs) = ifM (p x) (return True) (anyM p xs) --- | A version of 'all' lifted to a moand. Retains the short-circuiting behaviour.+-- | A version of 'all' lifted to a monad. Retains the short-circuiting behaviour. -- -- > allM Just [True,False,undefined] == Just False -- > allM Just [True,True ,undefined] == undefined@@ -144,7 +144,7 @@ allM p [] = return True allM p (x:xs) = ifM (p x) (allM p xs) (return False) --- | A version of 'or' lifted to a moand. Retains the short-circuiting behaviour.+-- | A version of 'or' lifted to a monad. Retains the short-circuiting behaviour. -- -- > orM [Just False,Just True ,undefined] == Just True -- > orM [Just False,Just False,undefined] == undefined@@ -152,7 +152,7 @@ orM :: Monad m => [m Bool] -> m Bool orM = anyM id --- | A version of 'and' lifted to a moand. Retains the short-circuiting behaviour.+-- | A version of 'and' lifted to a monad. Retains the short-circuiting behaviour. -- -- > andM [Just True,Just False,undefined] == Just False -- > andM [Just True,Just True ,undefined] == undefined
src/System/Directory/Extra.hs view
@@ -1,10 +1,22 @@ {-# LANGUAGE CPP #-} +#ifndef MIN_VERSION_directory+#if __GLASGOW_HASKELL__ >= 711+#define MIN_VERSION_directory(a,b,c) 1+#else+#define MIN_VERSION_directory(a,b,c) 0+#endif+#endif++ -- | Extra directory functions. Most of these functions provide cleaned up and generalised versions -- of 'getDirectoryContents', see 'listContents' for the differences. module System.Directory.Extra( module System.Directory,- withCurrentDirectory, createDirectoryPrivate,+#if !MIN_VERSION_directory(1,2,3)+ withCurrentDirectory,+#endif+ createDirectoryPrivate, listContents, listFiles, listFilesInside, listFilesRecursive ) where @@ -19,6 +31,7 @@ #endif +#if !MIN_VERSION_directory(1,2,3) -- | Set the current directory, perform an operation, then change back. -- Remember that the current directory is a global variable, so calling this function -- multithreaded is almost certain to go wrong. Avoid changing the current directory if you can.@@ -28,6 +41,7 @@ withCurrentDirectory dir act = bracket getCurrentDirectory setCurrentDirectory $ const $ do setCurrentDirectory dir; act+#endif -- | List the files and directories directly within a directory.