@@ -124,8 +124,8 @@ module Data.Attoparsec.Text
124124import Control.Applicative (pure, (<$>), (*>), (<*), (<|>))
125125import Data.Attoparsec.Combinator
126126import Data.Attoparsec.Number (Number(..))
127−import Data.Scientific (Scientific, coefficient, base10Exponent)
128−import qualified Data.Scientific as Sci (scientific)
127+import Data.Scientific (Scientific)
128+import qualified Data.Scientific as Sci
129129import Data.Attoparsec.Text.Internal (Parser, Result, parse, takeWhile1)
130130import Data.Bits (Bits, (.|.), shiftL)
131131import Data.Char (isAlpha, isDigit, isSpace, ord)
@@ -373,7 +373,7 @@ rational = scientifically realToFrac
373373-- This function does not accept string representations of \"NaN\" or
374374-- \"Infinity\".
375375double :: Parser Double
376−double = rational
376+double = scientifically Sci.toRealFloat
377377
378378-- | Parse a number, attempting to preserve both speed and precision.
379379--
@@ -388,11 +388,11 @@ double = rational
388388-- \"Infinity\".
389389number :: Parser Number
390390number = scientifically $ \s ->
391− let e = base10Exponent s
392− c = coefficient s
391+ let e = Sci.base10Exponent s
392+ c = Sci.coefficient s
393393 in if e >= 0
394394 then I (c * 10 ^ e)
395− else D (fromInteger c / 10 ^ negate e)
395+ else D (Sci.toRealFloat s)
396396
397397-- | Parse a scientific number.
398398--