[commit: packages/deepseq] master, typeable-with-kinds: Add `NFData` instance for new `Natural` type (#2) (eca9e86)
git at git.haskell.org
git at git.haskell.org
Thu Mar 19 11:35:19 UTC 2015
Repository : ssh://git@git.haskell.org/deepseq
On branches: master,typeable-with-kinds
Link : http://git.haskell.org/packages/deepseq.git/commitdiff/eca9e861402060a3b83cb569e360fd291e89308d
>---------------------------------------------------------------
commit eca9e861402060a3b83cb569e360fd291e89308d
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Sun Nov 23 16:25:32 2014 +0100
Add `NFData` instance for new `Natural` type (#2)
>---------------------------------------------------------------
eca9e861402060a3b83cb569e360fd291e89308d
Control/DeepSeq.hs | 8 ++++++++
changelog.md | 3 +++
2 files changed, 11 insertions(+)
diff --git a/Control/DeepSeq.hs b/Control/DeepSeq.hs
index f451b1b..c6bd510 100644
--- a/Control/DeepSeq.hs
+++ b/Control/DeepSeq.hs
@@ -64,6 +64,9 @@ import Data.Complex
import Data.Array
import Data.Fixed
import Data.Version
+#if MIN_VERSION_base(4,8,0)
+import Numeric.Natural ( Natural )
+#endif
#if __GLASGOW_HASKELL__ >= 702
import GHC.Generics
@@ -208,6 +211,11 @@ instance NFData Word16 where rnf !_ = ()
instance NFData Word32 where rnf !_ = ()
instance NFData Word64 where rnf !_ = ()
+#if MIN_VERSION_base(4,8,0)
+-- |/Since: 1.4.0.0/
+instance NFData Natural where rnf !_ = ()
+#endif
+
-- |/Since: 1.3.0.0/
instance NFData (Fixed a) where rnf !_ = ()
diff --git a/changelog.md b/changelog.md
index 9d1b80d..dd0170e 100644
--- a/changelog.md
+++ b/changelog.md
@@ -15,6 +15,9 @@
instance NFData XYZ where rnf x = seq x ()
+ * New `NFData` instances for `base` types:
+ - `Numeric.Natural.Natural`
+
## 1.3.0.2 *Nov 2013*
* Bundled with GHC 7.8.1
More information about the ghc-commits
mailing list