packages feed

bytestring-show 0.3.2 → 0.3.3

raw patch · 4 files changed

+31/−5 lines, 4 filesdep +integer-gmpdep ~arraydep ~basedep ~binaryPVP ok

version bump matches the API change (PVP)

Dependencies added: integer-gmp

Dependency ranges changed: array, base, binary, bytestring, containers, integer

API changes (from Hackage documentation)

+ Text.Show.ByteString: Put :: PairS a -> PutM a
+ Text.Show.ByteString: newtype PutM a :: * -> *
+ Text.Show.ByteString: runPut :: Put -> ByteString
+ Text.Show.ByteString: showpIntAtBase :: (Integral a) => a -> (Int -> Char) -> a -> Put
+ Text.Show.ByteString: type Put = PutM ()
+ Text.Show.ByteString: unPut :: PutM a -> PairS a

Files

Text/Show/ByteString.hs view
@@ -22,6 +22,8 @@                               -- * Putting digits                             , unsafePutDigit                             , putDigit+                              -- * Putting integers+                            , showpIntAtBase                               -- * Putting floats                             , showpGFloat                             , showpFFloat
Text/Show/ByteString/Int.hs view
@@ -27,7 +27,11 @@  putI :: Int# -> Put putI i#+#if __GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ >= 611+  | i# <# 0#  = let !(I# minInt#) = minInt+#else   | i# <# 0#  = let I# minInt# = minInt+#endif                 in if i# ==# minInt#                    then putWord8 45 >> putW (int2Word# (negateInt# (i# `quotInt#` 10#)))                                     >> putW (int2Word# (negateInt# (i# `remInt#` 10#)))
Text/Show/ByteString/Integer.hs view
@@ -16,8 +16,11 @@  import GHC.Base -#ifdef INTEGER_GMP++#if  __GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ < 611 import GHC.Integer.Internals+#elif __GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ >= 611+import GHC.Integer.GMP.Internals #endif  import GHC.Num@@ -108,3 +111,15 @@   | d == 1    = unsafePutDigit n   | otherwise = pblock' (d-1) q >> unsafePutDigit r  where (q, r) = n `quotRemInt` 10++-- | Shows an Integral number using the base specified by the first+-- argument and the chracter representation specified by the second.+showpIntAtBase :: Integral a => a -> (Int -> Char) -> a -> Put+showpIntAtBase b f n | n < 0     = putAscii '-' >> showpIntAtBase b f (-n)+                     | n == 0    = putAscii (f 0)+                     | otherwise = let+  go n | n == 0    = return ()+       | otherwise = go d >> putAscii (f $ fromIntegral m)+   where+   (d, m) = n `divMod` b+  in go n
bytestring-show.cabal view
@@ -1,5 +1,5 @@ name:              bytestring-show-version:           0.3.2+version:           0.3.3 license:           BSD3 license-file:      LICENSE author:            Dan Doel@@ -12,7 +12,7 @@ cabal-version:     >= 1.2.3  library-    build-depends: base, binary, bytestring >= 0.9, array, containers+    build-depends: base < 5, binary < 0.6, bytestring >= 0.9 && <= 1, array < 0.4, containers < 0.4      exposed-modules:         Text.Show.ByteString@@ -30,6 +30,11 @@     ghc-options:         -O2 -Wall -    if impl(ghc >= 6.9)-        build-depends: integer+    if impl(ghc >= 6.11)         cpp-options: -DINTEGER_GMP+        build-depends: integer-gmp >= 0.2 && < 0.3++    if impl(ghc >= 6.9) && impl(ghc < 6.11)+        cpp-options: -DINTEGER_GMP+        build-depends: integer >= 0.1 && < 0.2+