packages feed

hw-prim 0.6.2.14 → 0.6.2.15

raw patch · 2 files changed

+15/−13 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

hw-prim.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack  name:           hw-prim-version:        0.6.2.14+version:        0.6.2.15 synopsis:       Primitive functions and data types description:    Primitive functions and data types. category:       Data@@ -103,7 +103,7 @@     , directory           >= 1.2        && < 1.4     , exceptions          >= 0.8        && < 0.11     , hedgehog            >= 0.5        && < 0.7-    , hspec               >= 2.4        && <2.6+    , hspec               >= 2.4        && < 2.6     , hw-hspec-hedgehog   >= 0.1        && < 0.2     , hw-prim   if flag(bounds-checking-enabled)
src/HaskellWorks/Data/ByteString.hs view
@@ -105,17 +105,19 @@ rechunk :: Int -> [BS.ByteString] -> [BS.ByteString] rechunk size = go   where go (bs:bss) = let bsLen = BS.length bs in-          if bsLen < size-            then case size - bsLen of-              bsNeed -> case bss of-                (cs:css) -> case BS.length cs of-                  csLen | csLen >  bsNeed -> (bs <> BS.take bsNeed cs ):go (BS.drop bsNeed cs:css)-                  csLen | csLen == bsNeed -> (bs <> cs                ):go                    css-                  _     | otherwise       ->                            go ((bs <> cs)       :css)-                [] -> [bs]-            else if size == bsLen-              then bs:go bss-              else BS.take size bs:go (BS.drop size bs:bss)+          if bsLen > 0+            then if bsLen < size+              then case size - bsLen of+                bsNeed -> case bss of+                  (cs:css) -> case BS.length cs of+                    csLen | csLen >  bsNeed -> (bs <> BS.take bsNeed cs ):go (BS.drop bsNeed cs:css)+                    csLen | csLen == bsNeed -> (bs <> cs                ):go                    css+                    _     | otherwise       ->                            go ((bs <> cs)       :css)+                  [] -> [bs]+              else if size == bsLen+                then bs:go bss+                else BS.take size bs:go (BS.drop size bs:bss)+            else go bss         go [] = []  resegment :: Int -> [BS.ByteString] -> [BS.ByteString]