@@ -178,11 +178,11 @@ parseRealFloat _ Null = pure (0/0)
178parseRealFloat expected v = typeMismatch expected v
178parseRealFloat expected v = typeMismatch expected v
179{-# INLINE parseRealFloat #-}
179{-# INLINE parseRealFloat #-}
181−truncateIntegral :: Integral a => String -> Scientific -> Parser a
181+truncateIntegral :: forall a. Integral a => String -> Scientific -> Parser a
182−truncateIntegral expected s
182+truncateIntegral expected s =
183− | Scientific.isInteger s = pure (truncate s)
183+ case Scientific.floatingOrInteger s :: Either Double a of
184− | otherwise =
184+ Right x -> pure x
185− fail $ "Floating number specified for " ++ expected ++ ": " ++ show s
185+ Left _ -> fail $ "Floating number specified for " ++ expected ++ ": " ++ show s
186{-# INLINE truncateIntegral #-}
186{-# INLINE truncateIntegral #-}
188parseIntegral :: Integral a => String -> Value -> Parser a
188parseIntegral :: Integral a => String -> Value -> Parser a