[commit: deepseq] master: Add NFData instancess for (->), Fixed, Version (#5465) (4682d89)
Simon Marlow
marlowsd at gmail.com
Tue Sep 13 14:01:04 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/deepseq
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/4682d892b8224df8f340963d5f0ac5f768267de6
>---------------------------------------------------------------
commit 4682d892b8224df8f340963d5f0ac5f768267de6
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Wed Sep 7 13:20:53 2011 +0200
Add NFData instancess for (->), Fixed, Version (#5465)
Addresses #5465
>---------------------------------------------------------------
Control/DeepSeq.hs | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/Control/DeepSeq.hs b/Control/DeepSeq.hs
index a7ed499..41ccec3 100644
--- a/Control/DeepSeq.hs
+++ b/Control/DeepSeq.hs
@@ -54,6 +54,8 @@ import Data.Word
import Data.Ratio
import Data.Complex
import Data.Array
+import Data.Fixed
+import Data.Version
infixr 0 $!!
@@ -130,6 +132,8 @@ instance NFData Word16
instance NFData Word32
instance NFData Word64
+instance NFData (Fixed a)
+
--Rational and complex numbers.
instance (Integral a, NFData a) => NFData (Ratio a) where
@@ -148,6 +152,9 @@ instance (NFData a, NFData b) => NFData (Either a b) where
rnf (Left x) = rnf x
rnf (Right y) = rnf y
+instance NFData Data.Version.Version where
+ rnf (Data.Version.Version branch tags) = rnf branch `seq` rnf tags
+
instance NFData a => NFData [a] where
rnf [] = ()
rnf (x:xs) = rnf x `seq` rnf xs
More information about the Cvs-libraries
mailing list