From eca9e861402060a3b83cb569e360fd291e89308d Mon Sep 17 00:00:00 2001 From: Herbert Valerio Riedel <hvr@gnu.org> Date: Sun, 23 Nov 2014 16:25:32 +0100 Subject: [PATCH] Add `NFData` instance for new `Natural` type (#2) --- 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 -- GitLab