[commit: packages/deepseq] master, typeable-with-kinds: `NFData` instance for `Data.Void.Void` (d047c9e)
git at git.haskell.org
git at git.haskell.org
Thu Mar 19 11:35:47 UTC 2015
Repository : ssh://git@git.haskell.org/deepseq
On branches: master,typeable-with-kinds
Link : http://git.haskell.org/packages/deepseq.git/commitdiff/d047c9edd98cf09234e6e5f62dcf24c560f25f9d
>---------------------------------------------------------------
commit d047c9edd98cf09234e6e5f62dcf24c560f25f9d
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Sat Dec 6 10:31:21 2014 +0100
`NFData` instance for `Data.Void.Void`
>---------------------------------------------------------------
d047c9edd98cf09234e6e5f62dcf24c560f25f9d
Control/DeepSeq.hs | 7 +++++++
changelog.md | 1 +
2 files changed, 8 insertions(+)
diff --git a/Control/DeepSeq.hs b/Control/DeepSeq.hs
index 5da51f8..9f60d88 100644
--- a/Control/DeepSeq.hs
+++ b/Control/DeepSeq.hs
@@ -83,6 +83,7 @@ import Data.Proxy ( Proxy(Proxy) )
import Data.Functor.Identity ( Identity(..) )
-- NB: Data.Typeable.Internal is "Trustworthy" only starting w/ base-4.8
import Data.Typeable.Internal ( TypeRep(..), TyCon(..) )
+import Data.Void ( Void, absurd )
import Numeric.Natural ( Natural )
#endif
@@ -262,6 +263,12 @@ instance NFData (Proxy a) where rnf Proxy = ()
instance NFData a => NFData (Identity a) where
rnf = rnf . runIdentity
+-- | Defined as @'rnf' = 'absurd'@.
+--
+-- /Since: 1.4.0.0/
+instance NFData Void where
+ rnf = absurd
+
-- |/Since: 1.4.0.0/
instance NFData Natural where rnf !_ = ()
#endif
diff --git a/changelog.md b/changelog.md
index 7ba3108..5226ed2 100644
--- a/changelog.md
+++ b/changelog.md
@@ -27,6 +27,7 @@
- `Data.Typeable.Internal.TyCon`
- `Data.Typeable.Internal.TypeRep`
- `Data.Unique.Unique`
+ - `Data.Void.Void`
- `GHC.Fingerprint.Type.Fingerprint`
- `Numeric.Natural.Natural`
- `System.Mem.StableName.StableName`
More information about the ghc-commits
mailing list