blaze-textual 0.2.2.1 → 0.2.3
raw patch · 3 files changed
+17/−14 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Blaze/Text/Int.hs +6/−3
- blaze-textual.cabal +6/−11
- changelog.md +5/−0
Blaze/Text/Int.hs view
@@ -53,10 +53,11 @@ -- This definition of the function is here PURELY to be used by ghci -- and those rare cases where GHC is being invoked without -- optimization, as otherwise the rewrite rules above should fire. The--- test for "-0" catches an overflow if we render minBound.+-- test for `(-i) == i` catches when we render minBound, in which case+-- using `-i` would be wrong. An example is `-(-128 :: Int8) == -128`. integral i | i >= 0 = nonNegative i- | toByteString b == "-0" = fromString (show i)+ | (-i) == i = fromString (show i) | otherwise = b where b = minus `mappend` nonNegative (-i) {-# NOINLINE integral #-}@@ -86,7 +87,9 @@ {-# SPECIALIZE nonNegative :: Word16 -> Builder #-} {-# SPECIALIZE nonNegative :: Word32 -> Builder #-} {-# SPECIALIZE nonNegative :: Word64 -> Builder #-}-nonNegative = go+nonNegative x+ | x < 0 = error $ "nonNegative: Called with negative number " ++ show (fromIntegral x :: Integer)+ | otherwise = go x where go n | n < 10 = digit n | otherwise = go (n `quot` 10) `mappend` digit (n `rem` 10)
blaze-textual.cabal view
@@ -1,17 +1,16 @@ name: blaze-textual-version: 0.2.2.1+version: 0.2.3 license: BSD3 license-file: LICENSE category: Text copyright: Copyright 2011 MailRank, Inc. author: Bryan O'Sullivan <bos@serpentine.com>-maintainer: Bryan O'Sullivan <bos@serpentine.com>- , Andrey Prokopenko <persiantiger@yandex.ru>+maintainer: Andrey Prokopenko <persiantiger@yandex.ru> stability: experimental synopsis: Fast rendering of common datatypes cabal-version: 1.12-homepage: http://github.com/bos/blaze-textual-bug-reports: http://github.com/bos/blaze-textual/issues+homepage: http://github.com/swamp-agr/blaze-textual+bug-reports: http://github.com/swamp-agr/blaze-textual/issues build-type: Simple description: A library for efficiently rendering Haskell datatypes to@@ -20,7 +19,7 @@ /Note/: if you use GHCi or Template Haskell, please see the @README@ file for important details about building this package, and other packages that depend on it:- <https://github.com/bos/blaze-textual#readme>+ <https://github.com/swamp-agr/blaze-textual#readme> extra-source-files: README.markdown@@ -102,8 +101,4 @@ source-repository head type: git- location: http://github.com/bos/blaze-textual--source-repository head- type: mercurial- location: http://bitbucket.org/bos/blaze-textual+ location: http://github.com/swamp-agr/blaze-textual
changelog.md view
@@ -1,3 +1,8 @@+0.2.3 2023-03-02++* Fix incorrect minBound detection and `-128 :: Int8` (see [#12](https://github.com/swamp-agr/blaze-textual/pull/12)).++ 0.2.2.1 2021-08-30 * Restore support for GHC <9.