@@ -30,7 +30,7 @@ module Data.Aeson.Generic
3030import Control.Applicative ((<$>))
3131import Control.Arrow (first)
3232import Control.Monad.State.Strict
33−import Data.Aeson.Functions hiding (decode)
33+import Data.Aeson.Functions
3434import Data.Aeson.Types hiding (FromJSON(..), ToJSON(..), fromJSON)
3535import Data.Attoparsec.Number (Number)
3636import Data.Generics
@@ -39,14 +39,11 @@ import Data.Int (Int8, Int16, Int32, Int64)
3939import Data.IntSet (IntSet)
4040import Data.Maybe (fromJust)
4141import Data.Text (Text, pack, unpack)
42−import Data.Text.Encoding (encodeUtf8)
4342import Data.Time.Clock (UTCTime)
4443import Data.Word (Word, Word8, Word16, Word32, Word64)
4544import Data.Aeson.Parser.Internal (decodeWith, json, json')
4645import qualified Data.Aeson.Encode as E
47−import qualified Data.Aeson.Functions as F
4846import qualified Data.Aeson.Types as T
49−import qualified Data.ByteString as B
5047import qualified Data.ByteString.Lazy as L
5148import qualified Data.HashMap.Strict as H
5249import qualified Data.Map as Map
@@ -127,8 +124,6 @@ toJSON = toJSON_generic
127124 | tyrep == typeOf DT.empty = remap id
128125 | tyrep == typeOf LT.empty = remap LT.toStrict
129126 | tyrep == typeOf "" = remap pack
130− | tyrep == typeOf B.empty = remap F.decode
131− | tyrep == typeOf L.empty = remap strict
132127 | otherwise = modError "toJSON" $
133128 "cannot convert map keyed by type " ++ show tyrep
134129 where tyrep = typeOf . head . Map.keys $ m
@@ -138,8 +133,6 @@ toJSON = toJSON_generic
138133 | tyrep == typeOf DT.empty = remap id
139134 | tyrep == typeOf LT.empty = remap LT.toStrict
140135 | tyrep == typeOf "" = remap pack
141− | tyrep == typeOf B.empty = remap F.decode
142− | tyrep == typeOf L.empty = remap strict
143136 | otherwise = modError "toJSON" $
144137 "cannot convert map keyed by type " ++ show tyrep
145138 where tyrep = typeOf . head . H.keys $ m
@@ -235,8 +228,6 @@ parseJSON j = parseJSON_generic j
235228 | tyrep == typeOf DT.empty = process id
236229 | tyrep == typeOf LT.empty = process LT.fromStrict
237230 | tyrep == typeOf "" = process DT.unpack
238− | tyrep == typeOf B.empty = process encodeUtf8
239− | tyrep == typeOf L.empty = process lazy
240231 | otherwise = myFail
241232 where
242233 process f = maybe myFail return . cast =<< parseWith f
@@ -252,8 +243,6 @@ parseJSON j = parseJSON_generic j
252243 | tyrep == typeOf DT.empty = process id
253244 | tyrep == typeOf LT.empty = process LT.fromStrict
254245 | tyrep == typeOf "" = process DT.unpack
255− | tyrep == typeOf B.empty = process encodeUtf8
256− | tyrep == typeOf L.empty = process lazy
257246 | otherwise = myFail
258247 where
259248 process f = maybe myFail return . cast =<< parseWith f