on master help sign in
only provide json instances for array,smallarray,etc. when building against base >= 4.7
commit2d77af083515900b175623a52fa8e8cc06acd1b4 authorAndrew Martin <andrew.thaddeus@gmail.com> dateMon 17 Sep 2018, 15:40 (8 years ago) parentcf38cd3
2 files changed+4
Data/Aeson/Types/FromJSON.hs+2 Data/Aeson/Types/ToJSON.hs+2
Data/Aeson/Types/FromJSON.hs+2
@@ -1687,6 +1687,7 @@ instance FromJSON DotNetTime where
16871687-- primitive
16881688-------------------------------------------------------------------------------
16891689
1690+#if (MIN_VERSION_base(0,4,7))
16901691instance FromJSON a => FromJSON (PM.Array a) where
16911692 -- note: we could do better than this if vector exposed the data
16921693 -- constructor in Data.Vector.
@@ -1702,6 +1703,7 @@ instance (PM.Prim a,FromJSON a) => FromJSON (PM.PrimArray a) where
17021703instance (PM.PrimUnlifted a,FromJSON a) => FromJSON (PM.UnliftedArray a) where
17031704 parseJSON = fmap Exts.fromList . parseJSON
17041705#endif
1706+#endif
17051707
17061708-------------------------------------------------------------------------------
17071709-- time
Data/Aeson/Types/ToJSON.hs+2
@@ -1918,6 +1918,7 @@ formatMillis = take 3 . formatTime defaultTimeLocale "%q"
19181918-- primitive
19191919-------------------------------------------------------------------------------
19201920
1921+#if (MIN_VERSION_base(0,4,7))
19211922instance ToJSON a => ToJSON (PM.Array a) where
19221923 -- note: we could do better than this if vector exposed the data
19231924 -- constructor in Data.Vector.
@@ -1937,6 +1938,7 @@ instance (PM.PrimUnlifted a,ToJSON a) => ToJSON (PM.UnliftedArray a) where
19371938 toJSON = toJSON . Exts.toList
19381939 toEncoding = toEncoding . Exts.toList
19391940#endif
1941+#endif
19401942
19411943-------------------------------------------------------------------------------
19421944-- time