@@ -80,12 +80,12 @@ import Data.Char (toUpper)
8080import qualified Data.Vector as V
8181import Data.Text (Text, pack)
8282import qualified Data.Text as T
83−import Data.Text.Read (signed, decimal, double)
8483import Data.Text.Encoding (encodeUtf8, decodeUtf8With)
8584import Data.Text.Encoding.Error (lenientDecode)
8685import qualified Data.HashMap.Strict as M
8786import Data.Typeable
88−import Data.Attoparsec.Number
87+import Data.Attoparsec.ByteString (parseOnly)
88+import Data.Aeson.Parser (value)
8989import qualified Data.HashSet as HashSet
9090
9191encode :: ToJSON a => a -> ByteString
@@ -210,8 +210,7 @@ textToValue _ _ t
210210 | t `elem` ["null", "Null", "NULL", "~", ""] = Null
211211 | any (t `isLike`) ["y", "yes", "on", "true"] = Bool True
212212 | any (t `isLike`) ["n", "no", "off", "false"] = Bool False
213− | Right (x, "") <- signed decimal t = Number $ I x
214− | Right (x, "") <- double t = Number $ D x
213+ | Right (Number n) <- parseOnly value (encodeUtf8 t) = Number n
215214 | otherwise = String t
216215 where x `isLike` ref = x `elem` [ref, T.toUpper ref, titleCased]
217216 where titleCased = toUpper (T.head ref) `T.cons` T.tail ref