[commit: packages/deepseq] master, typeable-with-kinds: Add `NFData` instance for `Proxy` (3158132)

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


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

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

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

commit 3158132b3e958f847e65851ab831c7ff7bf43165
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sun Nov 23 16:57:52 2014 +0100

    Add `NFData` instance for `Proxy`


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

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

diff --git a/Control/DeepSeq.hs b/Control/DeepSeq.hs
index c6bd510..c374a6c 100644
--- a/Control/DeepSeq.hs
+++ b/Control/DeepSeq.hs
@@ -64,6 +64,11 @@ import Data.Complex
 import Data.Array
 import Data.Fixed
 import Data.Version
+
+#if MIN_VERSION_base(4,7,0)
+import Data.Proxy ( Proxy(Proxy) )
+#endif
+
 #if MIN_VERSION_base(4,8,0)
 import Numeric.Natural ( Natural )
 #endif
@@ -211,6 +216,11 @@ instance NFData Word16   where rnf !_ = ()
 instance NFData Word32   where rnf !_ = ()
 instance NFData Word64   where rnf !_ = ()
 
+#if MIN_VERSION_base(4,7,0)
+-- |/Since: 1.4.0.0/
+instance NFData (Proxy a) where rnf Proxy = ()
+#endif
+
 #if MIN_VERSION_base(4,8,0)
 -- |/Since: 1.4.0.0/
 instance NFData Natural  where rnf !_ = ()
diff --git a/changelog.md b/changelog.md
index dd0170e..891cd89 100644
--- a/changelog.md
+++ b/changelog.md
@@ -17,6 +17,7 @@
 
   * New `NFData` instances for `base` types:
      - `Numeric.Natural.Natural`
+     - `Data.Proxy.Proxy`
 
 ## 1.3.0.2  *Nov 2013*
 



More information about the ghc-commits mailing list