[commit: packages/deepseq] down, master: Expose NFData instance for Down on earlier versions of base (0792252)

git at git.haskell.org git at git.haskell.org
Wed Jul 19 21:59:23 UTC 2017


Repository : ssh://git@git.haskell.org/deepseq

On branches: down,master
Link       : http://git.haskell.org/packages/deepseq.git/commitdiff/07922524fbc3b8d220f1cc1b01a3d254d295e910

>---------------------------------------------------------------

commit 07922524fbc3b8d220f1cc1b01a3d254d295e910
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Mon Dec 12 15:22:10 2016 -0500

    Expose NFData instance for Down on earlier versions of base


>---------------------------------------------------------------

07922524fbc3b8d220f1cc1b01a3d254d295e910
 Control/DeepSeq.hs | 4 ++--
 changelog.md       | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Control/DeepSeq.hs b/Control/DeepSeq.hs
index 29c3dc1..875c3b1 100644
--- a/Control/DeepSeq.hs
+++ b/Control/DeepSeq.hs
@@ -88,6 +88,8 @@ import System.Mem.StableName ( StableName )
 
 #if MIN_VERSION_base(4,6,0)
 import Data.Ord ( Down(Down) )
+#else
+import GHC.Exts ( Down(Down) )
 #endif
 
 #if MIN_VERSION_base(4,7,0)
@@ -507,13 +509,11 @@ instance NFData2 Array where
     liftRnf2 r r' x = liftRnf2 r r (bounds x) `seq` liftRnf r' (Data.Array.elems x)
 #endif
 
-#if MIN_VERSION_base(4,6,0)
 -- |@since 1.4.0.0
 instance NFData a => NFData (Down a) where rnf = rnf1
 -- |@since 1.4.3.0
 instance NFData1 Down where
     liftRnf r (Down x) = r x
-#endif
 
 -- |@since 1.4.0.0
 instance NFData a => NFData (Dual a) where rnf = rnf1
diff --git a/changelog.md b/changelog.md
index 3a171cf..dc66b87 100644
--- a/changelog.md
+++ b/changelog.md
@@ -13,6 +13,7 @@
     ([#13](https://github.com/haskell/deepseq/issues/13))
   * Add `NFData Ordering` ([#25](https://github.com/haskell/deepseq/pull/25))
   * Add `NFData1` and `NFData2` type classes ([#8](https://github.com/haskell/deepseq/issues/8))
+  * Expose `NFData` instance for `Down` on earlier versions of `base`
 
 ## 1.4.2.0  *Apr 2016*
 



More information about the ghc-commits mailing list