[commit: packages/deepseq] master, typeable-with-kinds: `NFData` instances for `TyCon` and `TypeRep` (4beca42)

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


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

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

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

commit 4beca425214d11064e12c32bbf8e3d7a2ccd4df9
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Fri Dec 5 17:35:24 2014 +0100

    `NFData` instances for `TyCon` and `TypeRep`


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

4beca425214d11064e12c32bbf8e3d7a2ccd4df9
 Control/DeepSeq.hs | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/Control/DeepSeq.hs b/Control/DeepSeq.hs
index dfefe3e..c6763e5 100644
--- a/Control/DeepSeq.hs
+++ b/Control/DeepSeq.hs
@@ -58,6 +58,7 @@ module Control.DeepSeq (
   ) where
 
 import Control.Applicative
+import Control.Concurrent ( ThreadId )
 import Data.Int
 import Data.Word
 import Data.Ratio
@@ -66,6 +67,7 @@ import Data.Array
 import Data.Fixed
 import Data.Version
 import Data.Monoid
+import Data.Unique ( Unique )
 import Foreign.C.Types
 import System.Mem.StableName ( StableName )
 
@@ -334,7 +336,15 @@ instance NFData a => NFData (Product a) where
 
 -- |/Since: 1.4.0.0/
 instance NFData (StableName a) where
-    rnf !_ = ()
+    rnf !_ = () -- assumes `data StableName a = StableName (StableName# a)`
+
+-- |/Since: 1.4.0.0/
+instance NFData ThreadId where
+    rnf !_ = () -- assumes `data ThreadId = ThreadId ThreadId#`
+
+-- |/Since: 1.4.0.0/
+instance NFData Unique where
+    rnf !_ = () -- assumes `newtype Unique = Unique Integer`
 
 #if MIN_VERSION_base(4,8,0)
 -- | __NOTE__: Only defined for @base-4.8.0.0@ and later



More information about the ghc-commits mailing list