bytestring-show 0.3.5.1 → 0.3.5.2
raw patch · 2 files changed
+24/−10 lines, 2 filesdep +integer-simplePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: integer-simple
API changes (from Hackage documentation)
- Text.Show.ByteString: class Show a
+ Text.Show.ByteString: class Show a where showpPrec _ = showp showp = showpPrec 0 showpList [] = putWord8 91 >> putWord8 93 showpList (x : xs) = putWord8 91 >> showp x >> go xs where go (y : ys) = putWord8 44 >> showp y >> go ys go [] = putWord8 93
Files
- Text/Show/ByteString/Integer.hs +13/−7
- bytestring-show.cabal +11/−3
Text/Show/ByteString/Integer.hs view
@@ -16,11 +16,12 @@ import GHC.Base --#if __GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ < 611+#if __GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ < 611 && INTEGER_GMP import GHC.Integer.Internals-#elif __GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ >= 611+#elif __GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ >= 611 && INTEGER_GMP import GHC.Integer.GMP.Internals+#elif __GLASGOW_HASKELL__ && INTEGER_SIMPLE+import GHC.Integer.Simple.Internals #endif import GHC.Num@@ -37,7 +38,12 @@ where mi = fromIntegral (maxBound :: Int) showpInteger :: Integer -> Put+#ifdef INTEGER_SIMPLE+#elif INTEGER_GMP showpInteger (S# i#) = putI i#+#else+showpInteger (I# i#) = putI i#+#endif showpInteger n | n < 0 = putAscii '-' >> posIntegerPut (-n) | otherwise = posIntegerPut n@@ -56,7 +62,7 @@ splith :: Integer -> [Integer] -> [Integer] splith _ [ ] = error "splith: the impossible happened." splith p (n:ns) = case n `quotRemInteger` p of-#ifdef INTEGER_GMP+#if defined(INTEGER_GMP) || defined(INTEGER_SIMPLE) (# q, r #) -> #else (q, r) -> @@ -68,7 +74,7 @@ splitb :: Integer -> [Integer] -> [Integer] splitb _ [ ] = [] splitb p (n:ns) = case n `quotRemInteger` p of-#ifdef INTEGER_GMP+#if defined(INTEGER_GMP) || defined(INTEGER_SIMPLE) (# q, r #) -> #else (q, r) ->@@ -78,7 +84,7 @@ printh :: [Integer] -> Put printh [ ] = error "printh: the impossible happened." printh (n:ns) = case n `quotRemInteger` mx of-#ifdef INTEGER_GMP+#if defined(INTEGER_GMP) || defined(INTEGER_SIMPLE) (# q', r' #) -> #else (q', r') ->@@ -91,7 +97,7 @@ printb :: [Integer] -> Put printb [ ] = return () printb (n:ns) = case n `quotRemInteger` mx of-#ifdef INTEGER_GMP+#if defined(INTEGER_GMP) || defined(INTEGER_SIMPLE) (# q', r' #) -> #else (q', r') ->
bytestring-show.cabal view
@@ -1,5 +1,5 @@ name: bytestring-show-version: 0.3.5.1+version: 0.3.5.2 license: BSD3 license-file: LICENSE author: Dan Doel@@ -11,6 +11,10 @@ build-type: Simple cabal-version: >= 1.2.3 +flag integer-simple+ default: False+ description: use with integer-simple build of GHC+ library build-depends: base < 5, binary < 0.6, bytestring >= 0.9 && <= 1, array < 0.5, containers < 0.5 @@ -35,11 +39,15 @@ ghc-options: -O2 -Wall - if impl(ghc >= 6.11)+ if flag(integer-simple)+ cpp-options: -DINTEGER_SIMPLE+ build-depends: integer-simple++ if impl(ghc >= 6.11) && !flag(integer-simple) cpp-options: -DINTEGER_GMP build-depends: integer-gmp >= 0.2 && < 0.5 - if impl(ghc >= 6.9) && impl(ghc < 6.11)+ if impl(ghc >= 6.9) && impl(ghc < 6.11) && !flag(integer-simple) cpp-options: -DINTEGER_GMP build-depends: integer >= 0.1 && < 0.2