packages feed

bytestring-read 0.3.0 → 0.3.1

raw patch · 3 files changed

+10/−10 lines, 3 filesdep ~bytestring-lexingdep ~criteriondep ~doctestPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: bytestring-lexing, criterion, doctest, tasty

API changes (from Hackage documentation)

Files

bench/main.hs view
@@ -15,7 +15,7 @@  import qualified Data.ByteString.Read as R import qualified Data.Text.Read as T-import qualified Data.ByteString.Lex.Double as Lex+import qualified Data.ByteString.Lex.Fractional as Lex import qualified Data.Attoparsec.ByteString.Char8 as A  short :: IsString s => s@@ -38,7 +38,7 @@ text = either (const $ error "parse error") checkConsumed . T.signed T.double . T.decodeUtf8  bytestringLexing :: ByteString -> Double-bytestringLexing = maybe (error "parse error") checkConsumed . Lex.readDouble+bytestringLexing = maybe (error "parse error") checkConsumed . Lex.readSigned Lex.readExponential  attoparsec :: ByteString -> Double attoparsec = either (const $ error "parse error") id . A.parseOnly (fmap toRealFloat A.scientific)
bytestring-read.cabal view
@@ -1,5 +1,5 @@ name:                bytestring-read-version:             0.3.0+version:             0.3.1 synopsis:            fast ByteString to number converting library description:         benchmark: <http://philopon.github.io/bytestring-read/bench.html> license:             MIT@@ -33,8 +33,8 @@                      , bytestring-read                      , bytestring                      , text-                     , bytestring-lexing >=0.4  && <0.5-                     , criterion         >=1.0  && <1.2+                     , bytestring-lexing >=0.5  && <0.6+                     , criterion         >=0.8  && <1.2                      , scientific                      , attoparsec   ghc-options:         -Wall -O2
src/Data/ByteString/Read/Class.hs view
@@ -93,11 +93,11 @@     {-# INLINE isDigit #-};\     {-# INLINE unsafeToDigit #-};\     isDigit _ = \w -> 48 <= w && w <= 57 || 65 <= w && w <= MAXu || 97 <= w && w <= MAXl;\-    unsafeToDigit _ w = if 48 <= w && w <= 57;\-                        then fromIntegral w - 48;\-                        else if 65 <= w && w <= 90;\-                             then fromIntegral w - 55;\-                             else fromIntegral w - 87+    unsafeToDigit _ w = if w <= 57;\+                        then w - 48;\+                        else if w <= 90;\+                             then w - 55;\+                             else w - 87  defineRadixOver10(11, 65, 97) defineRadixOver10(12, 66, 98)