on master help sign in
Drop ByteString instances (gh-126)
commitf984a59141d1eba301accabb74291b15e78a45e5 authorBryan O'Sullivan <bos@serpentine.com> dateWed 18 Sep 2013, 09:01 (13 years ago) parent98426ee
2 files changed−20
Data/Aeson/Generic.hs−4 Data/Aeson/Types/Class.hs−16
Data/Aeson/Generic.hs−4
@@ -111,8 +111,6 @@ toJSON = toJSON_generic
111111 `extQ` (T.toJSON :: T Text)
112112 `extQ` (T.toJSON :: T LT.Text)
113113 `extQ` (T.toJSON :: T String)
114− `extQ` (T.toJSON :: T B.ByteString)
115− `extQ` (T.toJSON :: T L.ByteString)
116114 `extQ` (T.toJSON :: T T.Value)
117115 `extQ` (T.toJSON :: T DotNetTime)
118116 `extQ` (T.toJSON :: T UTCTime)
@@ -214,8 +212,6 @@ parseJSON j = parseJSON_generic j
214212 `extR` (value :: F Text)
215213 `extR` (value :: F LT.Text)
216214 `extR` (value :: F String)
217− `extR` (value :: F B.ByteString)
218− `extR` (value :: F L.ByteString)
219215 `extR` (value :: F T.Value)
220216 `extR` (value :: F DotNetTime)
221217 `extR` (value :: F UTCTime)
Data/Aeson/Types/Class.hs−16
@@ -474,22 +474,6 @@ instance FromJSON LT.Text where
474474 parseJSON = withText "Lazy Text" $ pure . LT.fromStrict
475475 {-# INLINE parseJSON #-}
476476
477−instance ToJSON B.ByteString where
478− toJSON = String . decode
479− {-# INLINE toJSON #-}
480−
481−instance FromJSON B.ByteString where
482− parseJSON = withText "ByteString" $ pure . encodeUtf8
483− {-# INLINE parseJSON #-}
484−
485−instance ToJSON LB.ByteString where
486− toJSON = toJSON . strict
487− {-# INLINE toJSON #-}
488−
489−instance FromJSON LB.ByteString where
490− parseJSON = withText "Lazy ByteString" $ pure . lazy
491− {-# INLINE parseJSON #-}
492−
493477instance (ToJSON a) => ToJSON [a] where
494478 toJSON = Array . V.fromList . map toJSON
495479 {-# INLINE toJSON #-}