extra 1.4.7 → 1.4.8
raw patch · 5 files changed
+28/−4 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Control.Exception.Extra: displayException :: Exception e => e -> String
+ Extra: displayException :: Exception e => e -> String
Files
- CHANGES.txt +2/−0
- README.md +13/−0
- extra.cabal +1/−1
- src/Control/Exception/Extra.hs +11/−2
- src/Extra.hs +1/−1
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for Extra +1.4.8+ Add displayException 1.4.7 #21, add concatForM 1.4.6
README.md view
@@ -9,6 +9,7 @@ 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. + ## Which functions? When producing a library of extra functions I have been guided by a few principles. I encourage others with small useful utility functions contribute them here, perhaps as a temporary stop before proposing they join the standard libraries.@@ -17,3 +18,15 @@ * The functions follow the spirit of the original Prelude/base libraries. I am happy to provide partial functions (e.g. `fromRight`), and functions which are specialisations of more generic functions (`whenJust`). * Most of the functions have trivial implementations. If a beginner couldn't write the function, it probably doesn't belong here. * I have defined only a few new data types or type aliases. It's a package for defining new utilities on existing types, not new types or concepts.+++## Base versions++The following GHC versions correspond to the following base library versions:++* base 4.9 == GHC 8.0+* base 4.8 == GHC 7.10+* base 4.7 == GHC 7.8+* base 4.6 == GHC 7.6+* base 4.5 == GHC 7.4+* base 4.4 == GHC 7.2
extra.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.10 build-type: Simple name: extra-version: 1.4.7+version: 1.4.8 license: BSD3 license-file: LICENSE category: Development
src/Control/Exception/Extra.hs view
@@ -1,4 +1,5 @@-{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE ScopedTypeVariables, CPP #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-} -- | Extra functions for "Control.Exception". -- These functions provide retrying, showing in the presence of exceptions,@@ -7,7 +8,7 @@ module Control.Exception, retry, retryBool, showException, stringException,- errorIO,+ errorIO, displayException, -- * Exception catching/ignoring ignore, catch_, handle_, try_,@@ -41,6 +42,14 @@ -- can themselves contain undefined values. showException :: Show e => e -> IO String showException = stringException . show+++#if __GLASGOW_HASKELL__ < 710+-- | Render this exception value in a human-friendly manner.+-- Part of the 'Exception' class in GHC 7.10 onwards.+displayException :: Exception e => e -> String+displayException = show+#endif -- | Ignore any exceptions thrown by the action.
src/Extra.hs view
@@ -11,7 +11,7 @@ getNumCapabilities, setNumCapabilities, withNumCapabilities, forkFinally, once, onceFork, Lock, newLock, withLock, withLockTry, Var, newVar, readVar, modifyVar, modifyVar_, withVar, Barrier, newBarrier, signalBarrier, waitBarrier, waitBarrierMaybe, -- * Control.Exception.Extra -- | Extra functions available in @"Control.Exception.Extra"@.- retry, retryBool, showException, stringException, errorIO, ignore, catch_, handle_, try_, catchJust_, handleJust_, tryJust_, catchBool, handleBool, tryBool,+ retry, retryBool, showException, stringException, errorIO, displayException, ignore, catch_, handle_, try_, catchJust_, handleJust_, tryJust_, catchBool, handleBool, tryBool, -- * Control.Monad.Extra -- | Extra functions available in @"Control.Monad.Extra"@. whenJust, whenJustM, unit, maybeM, eitherM, loopM, whileM, partitionM, concatMapM, concatForM, mconcatMapM, mapMaybeM, findM, firstJustM, whenM, unlessM, ifM, notM, (||^), (&&^), orM, andM, anyM, allM,