git.iko.soy/typeable/attoparsec
on master help sign in
Replace isDig with isDigit_w8 function
commit4a365dc1650072cfffe18c19431ba5514d8308b2 authorSlava Bacherikov <slava@bacher09.org> dateTue 23 Jun 2015, 21:39 (11 years ago) parentdbb9182
1 file changed+2−3
Data/Attoparsec/ByteString/Char8.hs+2−3
Data/Attoparsec/ByteString/Char8.hs+2−3
@@ -444,9 +444,8 @@ hexadecimal = B8.foldl' step 0 `fmap` I.takeWhile1 isHexDigit
444444
445445-- | Parse and decode an unsigned decimal number.
446446decimal :: Integral a => Parser a
447−decimal = B8.foldl' step 0 `fmap` I.takeWhile1 isDig
448− where isDig w = w >= 48 && w <= 57
449− step a w = a * 10 + fromIntegral (w - 48)
447+decimal = B8.foldl' step 0 `fmap` I.takeWhile1 isDigit_w8
448+ where step a w = a * 10 + fromIntegral (w - 48)
450449{-# SPECIALISE decimal :: Parser Int #-}
451450{-# SPECIALISE decimal :: Parser Int8 #-}
452451{-# SPECIALISE decimal :: Parser Int16 #-}