text-show 2.1 → 2.1.1
raw patch · 6 files changed
+36/−11 lines, 6 filesdep ~semigroupsdep ~text-showPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: semigroups, text-show
API changes (from Hackage documentation)
Files
- CHANGELOG.md +3/−0
- src/TextShow/Data/Fixed.hs +1/−2
- src/TextShow/Foreign/Ptr.hs +1/−2
- src/TextShow/GHC/Fingerprint.hs +1/−2
- src/TextShow/Utils.hs +26/−1
- text-show.cabal +4/−4
CHANGELOG.md view
@@ -1,3 +1,6 @@+# 2.1.1+* Restore support for `semigroups-0.16.1`+ # 2.1 * Require `semigroups` >= 0.17 * Added `showsToShowb` and `showbToShows` to `TextShow`
src/TextShow/Data/Fixed.hs view
@@ -26,11 +26,10 @@ import Data.Fixed (Fixed(..)) import Data.Int (Int64) import Data.Monoid.Compat ((<>))-import Data.Semigroup (mtimesDefault) import Data.Text.Lazy.Builder (singleton) import TextShow.Data.Integral ()-import TextShow.Utils (lengthB)+import TextShow.Utils (lengthB, mtimesDefault) #else import Data.Fixed (Fixed, showFixed) import Data.Text.Lazy.Builder (fromString)
src/TextShow/Foreign/Ptr.hs view
@@ -23,7 +23,6 @@ ) where import Data.Monoid.Compat ((<>))-import Data.Semigroup (mtimesDefault) import Data.Text.Lazy.Builder (Builder, singleton) import Foreign.ForeignPtr (ForeignPtr)@@ -36,7 +35,7 @@ import TextShow.Classes (TextShow(showb, showbPrec), TextShow1(..)) import TextShow.Data.Integral (showbHex, showbIntPrec, showbWord)-import TextShow.Utils (lengthB)+import TextShow.Utils (lengthB, mtimesDefault) #include "MachDeps.h" #include "inline.h"
src/TextShow/GHC/Fingerprint.hs view
@@ -24,7 +24,6 @@ ) where import Data.Monoid.Compat ((<>))-import Data.Semigroup (mtimesDefault) import Data.Text.Lazy.Builder (Builder, singleton) import Data.Word (Word64) @@ -32,7 +31,7 @@ import TextShow.Classes (TextShow(showb)) import TextShow.Data.Integral (showbHex)-import TextShow.Utils (lengthB)+import TextShow.Utils (lengthB, mtimesDefault) -- | Convert a 'Fingerprint' to a 'Builder'. -- This function is only available with @base-4.4.0.0@ or later.
src/TextShow/Utils.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE MagicHash #-} {-|@@ -10,11 +11,26 @@ Miscellaneous utility functions. -}-module TextShow.Utils where+module TextShow.Utils (+ i2d+ , isInfixTypeCon+ , isTupleString+ , lengthB+ , mtimesDefault+ , toString+ , toText+ , unlinesB+ , unwordsB+ ) where import Data.Int (Int64) import Data.Text (Text) import Data.Monoid.Compat ((<>))+#if MIN_VERSION_semigroups(0,17,0)+import Data.Semigroup (mtimesDefault)+#else+import Data.Semigroup (timesN)+#endif import Data.Text.Lazy (length, toStrict, unpack) import Data.Text.Lazy.Builder (Builder, singleton, toLazyText) @@ -48,6 +64,15 @@ lengthB :: Builder -> Int64 lengthB = length . toLazyText {-# INLINE lengthB #-}++#if !(MIN_VERSION_semigroups(0,17,0))+-- | Repeat a value @n@ times.+--+-- > mtimesDefault n a = a <> a <> ... <> a -- using <> (n-1) times+mtimesDefault :: (Integral b, Monoid a) => b -> a -> a+mtimesDefault = timesN . fromIntegral+{-# INLINE mtimesDefault #-}+#endif -- | Convert a 'Builder' to a 'String' (without surrounding it with double quotes, -- as 'show' would).
text-show.cabal view
@@ -1,5 +1,5 @@ name: text-show-version: 2.1+version: 2.1.1 synopsis: Efficient conversion of values into Text description: @text-show@ offers a replacement for the @Show@ typeclass intended for use with @Text@ instead of @String@s. This package was created@@ -142,7 +142,7 @@ , ghc-prim , integer-gmp , nats >= 0.1 && < 2- , semigroups >= 0.17 && < 1+ , semigroups >= 0.16.1 && < 1 , tagged >= 0.4.4 && < 1 , text >= 0.11.1 && < 1.3 , template-haskell >= 2.5 && < 2.12@@ -157,7 +157,7 @@ install-includes: inline.h , utils.h -test-suite text-show-spec+test-suite spec type: exitcode-stdio-1.0 main-is: Spec.hs other-modules: Derived.DataFamilies@@ -314,7 +314,7 @@ , quickcheck-instances >= 0.1 && < 0.4 , tagged >= 0.8.1 && < 1 , text >= 0.11.1 && < 1.3- , text-show == 2.1+ , text-show == 2.1.1 , transformers >= 0.2.1 && < 0.5 , transformers-compat >= 0.3 && < 1 , void >= 0.5 && < 1