on master help sign in
Allow aeson 0.3 to work with deepseq 1.2
01495c0Michael Snoyman
Data/Aeson/Types.hs+8−1
@@ -212,13 +212,20 @@ data Value = Object Object
212 deriving (Eq, Show, Typeable, Data)
212 deriving (Eq, Show, Typeable, Data)
213
213
214instance NFData Value where
214instance NFData Value where
215− rnf (Object o) = rnf o
215+ rnf (Object o) = obj_rnf o
216 rnf (Array a) = V.foldl' (\x y -> rnf y `seq` x) () a
216 rnf (Array a) = V.foldl' (\x y -> rnf y `seq` x) () a
217 rnf (String s) = rnf s
217 rnf (String s) = rnf s
218 rnf (Number n) = case n of I i -> rnf i; D d -> rnf d
218 rnf (Number n) = case n of I i -> rnf i; D d -> rnf d
219 rnf (Bool b) = rnf b
219 rnf (Bool b) = rnf b
220 rnf Null = ()
220 rnf Null = ()
221
221
222+obj_rnf :: (NFData k, NFData v) => Map k v -> ()
223+#if MIN_VERSION_containers(0,4,2)
224+obj_rnf = rnf
225+#else
226+obj_rnf = rnf . M.toList
227+#endif
228+
222instance IsString Value where
229instance IsString Value where
223 fromString = String . pack
230 fromString = String . pack
224 {-# INLINE fromString #-}
231 {-# INLINE fromString #-}
aeson.cabal+2−2
@@ -1,5 +1,5 @@
1name: aeson
1name: aeson
2−version: 0.3.2.11
2+version: 0.3.2.13
3license: BSD3
3license: BSD3
4license-file: LICENSE
4license-file: LICENSE
5category: Text, Web, JSON
5category: Text, Web, JSON
@@ -121,7 +121,7 @@ library
121 blaze-textual >= 0.2.0.2,
121 blaze-textual >= 0.2.0.2,
122 bytestring,
122 bytestring,
123 containers,
123 containers,
124− deepseq < 1.2,
124+ deepseq,
125 hashable >= 1.1.2.0,
125 hashable >= 1.1.2.0,
126 mtl,
126 mtl,
127 old-locale,
127 old-locale,