Created
November 30, 2011 06:53
-
-
Save snoyberg/1408290 to your computer and use it in GitHub Desktop.
Allow aeson 0.3 to work with deepseq 1.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Data/Aeson/Types.hs b/Data/Aeson/Types.hs | |
index 8454bab..290d54f 100644 | |
--- a/Data/Aeson/Types.hs | |
+++ b/Data/Aeson/Types.hs | |
@@ -212,13 +212,20 @@ data Value = Object Object | |
deriving (Eq, Show, Typeable, Data) | |
instance NFData Value where | |
- rnf (Object o) = rnf o | |
+ rnf (Object o) = obj_rnf o | |
rnf (Array a) = V.foldl' (\x y -> rnf y `seq` x) () a | |
rnf (String s) = rnf s | |
rnf (Number n) = case n of I i -> rnf i; D d -> rnf d | |
rnf (Bool b) = rnf b | |
rnf Null = () | |
+obj_rnf :: (NFData k, NFData v) => Map k v -> () | |
+#if MIN_VERSION_containers(0,4,2) | |
+obj_rnf = rnf | |
+#else | |
+obj_rnf = rnf . M.toList | |
+#endif | |
+ | |
instance IsString Value where | |
fromString = String . pack | |
{-# INLINE fromString #-} | |
diff --git a/aeson.cabal b/aeson.cabal | |
index ab390ab..4b3e3e6 100644 | |
--- a/aeson.cabal | |
+++ b/aeson.cabal | |
@@ -1,5 +1,5 @@ | |
name: aeson | |
-version: 0.3.2.12 | |
+version: 0.3.2.13 | |
license: BSD3 | |
license-file: LICENSE | |
category: Text, Web, JSON | |
@@ -121,7 +121,7 @@ library | |
blaze-textual >= 0.2.0.2, | |
bytestring, | |
containers, | |
- deepseq < 1.2, | |
+ deepseq, | |
hashable >= 1.1.2.0, | |
mtl, | |
old-locale, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment