@@ -43,7 +43,7 @@ import Data.ByteString.Lazy.Builder
44import Control.Applicative ((*>), (<$>), (<*), liftA2, pure)
44import Control.Applicative ((*>), (<$>), (<*), liftA2, pure)
45import Data.Aeson.Types (Result(..), Value(..))
45import Data.Aeson.Types (Result(..), Value(..))
46−import Data.Attoparsec.Char8 (Parser, char, endOfInput, rational,
46+import Data.Attoparsec.Char8 (Parser, char, endOfInput, scientific,
47 skipSpace, string)
47 skipSpace, string)
48import Data.Bits ((.|.), shiftL)
48import Data.Bits ((.|.), shiftL)
49import Data.ByteString (ByteString)
49import Data.ByteString (ByteString)
@@ -173,7 +173,7 @@ value = do
173 C_t -> string "true" *> pure (Bool True)
173 C_t -> string "true" *> pure (Bool True)
174 C_n -> string "null" *> pure Null
174 C_n -> string "null" *> pure Null
175 _ | w >= 48 && w <= 57 || w == 45
175 _ | w >= 48 && w <= 57 || w == 45
176− -> Number <$> rational
176+ -> Number <$> scientific
177 | otherwise -> fail "not a valid json value"
177 | otherwise -> fail "not a valid json value"
179-- | Strict version of 'value'. See also 'json''.
179-- | Strict version of 'value'. See also 'json''.
@@ -191,7 +191,7 @@ value' = do
191 C_n -> string "null" *> pure Null
191 C_n -> string "null" *> pure Null
192 _ | w >= 48 && w <= 57 || w == 45
192 _ | w >= 48 && w <= 57 || w == 45
194− !n <- rational
194+ !n <- scientific
195 return (Number n)
195 return (Number n)
196 | otherwise -> fail "not a valid json value"
196 | otherwise -> fail "not a valid json value"