[commit: packages/deepseq] master, typeable-with-kinds: `NFData` instances for `Data.Ord.Down` wrapper (f5d69c4)

git at git.haskell.org git at git.haskell.org
Thu Mar 19 11:35:45 UTC 2015


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

On branches: master,typeable-with-kinds
Link       : http://git.haskell.org/packages/deepseq.git/commitdiff/f5d69c46793f15202bb01a98bdee63a7f8a0ca9a

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

commit f5d69c46793f15202bb01a98bdee63a7f8a0ca9a
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Fri Dec 5 17:42:05 2014 +0100

    `NFData` instances for `Data.Ord.Down` wrapper


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

f5d69c46793f15202bb01a98bdee63a7f8a0ca9a
 Control/DeepSeq.hs | 10 ++++++++++
 changelog.md       |  1 +
 2 files changed, 11 insertions(+)

diff --git a/Control/DeepSeq.hs b/Control/DeepSeq.hs
index c6763e5..5da51f8 100644
--- a/Control/DeepSeq.hs
+++ b/Control/DeepSeq.hs
@@ -71,6 +71,10 @@ import Data.Unique ( Unique )
 import Foreign.C.Types
 import System.Mem.StableName ( StableName )
 
+#if MIN_VERSION_base(4,6,0)
+import Data.Ord ( Down(Down) )
+#endif
+
 #if MIN_VERSION_base(4,7,0)
 import Data.Proxy ( Proxy(Proxy) )
 #endif
@@ -308,6 +312,12 @@ instance NFData a => NFData (Const a b) where
 instance (Ix a, NFData a, NFData b) => NFData (Array a b) where
     rnf x = rnf (bounds x, Data.Array.elems x)
 
+#if MIN_VERSION_base(4,6,0)
+-- |/Since: 1.4.0.0/
+instance NFData a => NFData (Down a) where
+    rnf (Down x) = rnf x
+#endif
+
 -- |/Since: 1.4.0.0/
 instance NFData a => NFData (Dual a) where
     rnf = rnf . getDual
diff --git a/changelog.md b/changelog.md
index 28fd840..7ba3108 100644
--- a/changelog.md
+++ b/changelog.md
@@ -22,6 +22,7 @@
      - `Control.Concurrent.ThreadId`
      - `Data.Functor.Identity.Identity`
      - `Data.Monoid.{Dual,First,Last,Any,All,Sum,Product}`
+     - `Data.Ord.Down`
      - `Data.Proxy.Proxy`
      - `Data.Typeable.Internal.TyCon`
      - `Data.Typeable.Internal.TypeRep`



More information about the ghc-commits mailing list