packages feed

bytestring-lexing 0.4.2 → 0.4.3

raw patch · 3 files changed

+11/−5 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

VERSION view
@@ -1,3 +1,5 @@+0.4.3 (2013.03.21):+    - Data.ByteString.Lex.Integral: Corrected a segmentation fault in packDecimal. 0.4.2 (2013.03.20):     - Data.ByteString.Lex.Integral: Improved packDecimal. 0.4.1 (2012.00.00):
bytestring-lexing.cabal view
@@ -8,7 +8,7 @@ Build-Type:     Simple  Name:           bytestring-lexing-Version:        0.4.2+Version:        0.4.3 Stability:      provisional Homepage:       http://code.haskell.org/~wren/ Author:         wren ng thornton, Don Stewart
src/Data/ByteString/Lex/Integral.hs view
@@ -1,6 +1,6 @@ {-# OPTIONS_GHC -Wall -fwarn-tabs #-} -------------------------------------------------------------------                                                    2013.03.20+--                                                    2013.03.21 -- | -- Module      :  Data.ByteString.Lex.Integral -- Copyright   :  Copyright (c) 2010--2013 wren ng thornton@@ -772,10 +772,14 @@ numDecimalDigits :: (Integral a) => a -> Int {-# INLINE numDecimalDigits #-} numDecimalDigits n0-    | n0 < 0    = error (_numDecimalDigits ++ _negativeNumber)-    -- BUG: need to check n0 to be sure we won't overflow Word64-    | otherwise = go 1 (fromIntegral n0 :: Word64)+    | n0 < 0     = error (_numDecimalDigits ++ _negativeNumber)+    -- Unfortunately this causes significant (1.2x) slowdown since+    -- GHC can't see it will always fail for types other than Integer...+    | n0 > limit = numDigits 10 (toInteger n0)+    | otherwise  = go 1 (fromIntegral n0 :: Word64)     where+    limit = fromIntegral (maxBound :: Word64)+         fin n bound = if n >= bound then 1 else 0     go k n         | k `seq` False = undefined -- For strictness analysis