[commit: packages/deepseq] wip/ttypeable: Update deepseq for type-indexed type representations (c3a0a16)

git at git.haskell.org git at git.haskell.org
Wed Jul 19 21:58:49 UTC 2017


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

On branch  : wip/ttypeable
Link       : http://git.haskell.org/packages/deepseq.git/commitdiff/c3a0a16f17e593cb6a64b01a22015497738bfed6

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

commit c3a0a16f17e593cb6a64b01a22015497738bfed6
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Wed Mar 16 11:25:11 2016 +0100

    Update deepseq for type-indexed type representations


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

c3a0a16f17e593cb6a64b01a22015497738bfed6
 Control/DeepSeq.hs | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/Control/DeepSeq.hs b/Control/DeepSeq.hs
index 49bac36..4e4379c 100644
--- a/Control/DeepSeq.hs
+++ b/Control/DeepSeq.hs
@@ -86,9 +86,14 @@ import Data.Ord ( Down(Down) )
 import Data.Proxy ( Proxy(Proxy) )
 #endif
 
+#if MIN_VERSION_base(4,9,0)
+import Type.Reflection ( TypeRep, TypeRepX, TyCon, rnfTypeRep, rnfTypeRepX, rnfTyCon )
+#elif MIN_VERSION_base(4,8,0)
+import Data.Typeable ( TypeRep, TyCon, rnfTypeRep, rnfTyCon )
+#endif
+
 #if MIN_VERSION_base(4,8,0)
 import Data.Functor.Identity ( Identity(..) )
-import Data.Typeable ( TypeRep, TyCon, rnfTypeRep, rnfTyCon )
 import Data.Void ( Void, absurd )
 import Numeric.Natural ( Natural )
 #endif
@@ -406,7 +411,27 @@ instance NFData ThreadId where
 instance NFData Unique where
     rnf !_ = () -- assumes `newtype Unique = Unique Integer`
 
-#if MIN_VERSION_base(4,8,0)
+#if MIN_VERSION_base(4,9,0)
+-- | __NOTE__: Only defined for @base-4.9.0.0@ and later
+--
+-- @since 1.4.0.0
+instance NFData (TypeRep a) where
+    rnf tyrep = rnfTypeRep tyrep
+
+-- | __NOTE__: Only defined for @base-4.8.0.0@ and later
+--
+-- @since 1.4.0.0
+instance NFData TypeRepX where
+    rnf tyrep = rnfTypeRepX tyrep
+
+-- | __NOTE__: Only defined for @base-4.8.0.0@ and later
+--
+-- @since 1.4.0.0
+instance NFData TyCon where
+    rnf tycon = rnfTyCon tycon
+
+#elif MIN_VERSION_base(4,8,0)
+
 -- | __NOTE__: Only defined for @base-4.8.0.0@ and later
 --
 -- @since 1.4.0.0



More information about the ghc-commits mailing list