[commit: packages/deepseq] master: Add instance for System.Exit.ExitCode (6c0bfd5)
git at git.haskell.org
git at git.haskell.org
Wed Apr 20 13:05:10 UTC 2016
Repository : ssh://git@git.haskell.org/deepseq
On branch : master
Link : http://git.haskell.org/packages/deepseq.git/commitdiff/6c0bfd5ad979ac060f95fe9edd414889f55ddb7b
>---------------------------------------------------------------
commit 6c0bfd5ad979ac060f95fe9edd414889f55ddb7b
Author: Eric Mertens <emertens at gmail.com>
Date: Mon Oct 12 23:38:46 2015 -0700
Add instance for System.Exit.ExitCode
Fixes #4
>---------------------------------------------------------------
6c0bfd5ad979ac060f95fe9edd414889f55ddb7b
Control/DeepSeq.hs | 9 +++++++++
changelog.md | 5 ++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/Control/DeepSeq.hs b/Control/DeepSeq.hs
index cec8207..ff3252d 100644
--- a/Control/DeepSeq.hs
+++ b/Control/DeepSeq.hs
@@ -74,6 +74,7 @@ import Data.Monoid
import Data.Unique ( Unique )
import Foreign.Ptr
import Foreign.C.Types
+import System.Exit ( ExitCode(..) )
import System.Mem.StableName ( StableName )
#if MIN_VERSION_base(4,6,0)
@@ -537,6 +538,14 @@ instance NFData CFpos where rnf !_ = ()
instance NFData CJmpBuf where rnf !_ = ()
----------------------------------------------------------------------------
+-- System.Exit
+
+-- |/Since: 1.4.2.0/
+instance NFData ExitCode where
+ rnf (ExitFailure n) = rnf n
+ rnf ExitSuccess = ()
+
+----------------------------------------------------------------------------
-- Tuples
instance (NFData a, NFData b) => NFData (a,b) where
diff --git a/changelog.md b/changelog.md
index 794d5ee..29a222d 100644
--- a/changelog.md
+++ b/changelog.md
@@ -5,9 +5,12 @@
* Added instances for `Ptr` and `FunPtr`
([#10](https://github.com/haskell/deepseq/pull/10))
- * Added instance for `IORef` and `MVar`
+ * Added instances for `IORef` and `MVar`
([#6](https://github.com/haskell/deepseq/issues/6))
+ * Added instance for `ExitCode`
+ ([#4](https://github.com/haskell/deepseq/issues/4))
+
## 1.4.1.2 *Aug 2015*
* Avoid the broken combination of GHC-7.2 with `array>=0.4`
More information about the ghc-commits
mailing list