git.iko.soy/typeable/attoparsec
on master help sign in
Replace isDig with isDigit_w8 function
4a365dcSlava Bacherikov
Data/Attoparsec/ByteString/Char8.hs+2−3
@@ -444,9 +444,8 @@ hexadecimal = B8.foldl' step 0 `fmap` I.takeWhile1 isHexDigit
444
444
445-- | Parse and decode an unsigned decimal number.
445-- | Parse and decode an unsigned decimal number.
446decimal :: Integral a => Parser a
446decimal :: Integral a => Parser a
447−decimal = B8.foldl' step 0 `fmap` I.takeWhile1 isDig
447+decimal = B8.foldl' step 0 `fmap` I.takeWhile1 isDigit_w8
448− where isDig w = w >= 48 && w <= 57
449− step a w = a * 10 + fromIntegral (w - 48)
448+ where step a w = a * 10 + fromIntegral (w - 48)
450{-# SPECIALISE decimal :: Parser Int #-}
449{-# SPECIALISE decimal :: Parser Int #-}
451{-# SPECIALISE decimal :: Parser Int8 #-}
450{-# SPECIALISE decimal :: Parser Int8 #-}
452{-# SPECIALISE decimal :: Parser Int16 #-}
451{-# SPECIALISE decimal :: Parser Int16 #-}