text-show 3.8.3 → 3.8.4
raw patch · 6 files changed
+42/−19 lines, 6 filesdep ~base-orphans
Dependency ranges changed: base-orphans
Files
- CHANGELOG.md +4/−0
- src/TextShow/Control/Concurrent.hs +11/−1
- src/TextShow/Data/Ord.hs +23/−7
- tests/Derived/TypeSynonyms.hs +2/−7
- tests/Instances/GHC/RTS/Flags.hs +0/−2
- text-show.cabal +2/−2
CHANGELOG.md view
@@ -1,3 +1,7 @@+### 3.8.4 [2020.01.28]+* Update the `TextShow(1)` instances for `Down` and `ThreadId` to match their+ implementations in `base-4.14`.+ ### 3.8.3 [2019.11.06] * Use `base-compat-batteries-0.11.0` to define instances for `(:~:)` back to `base-4.5` and instances for `(:~~:)` back to `base-4.9`.
src/TextShow/Control/Concurrent.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE TemplateHaskell #-}@@ -32,9 +33,18 @@ import TextShow.Foreign.C.Types () import TextShow.TH.Internal (deriveTextShow) +#if MIN_VERSION_base(4,14,0)+import TextShow.Classes (showbParen)+import GHC.Show (appPrec)+#endif+ -- | /Since: 2/ instance TextShow ThreadId where- showbPrec p t = fromString "ThreadId " <> showbPrec p (getThreadId t)+ showbPrec p t =+#if MIN_VERSION_base(4,14,0)+ showbParen (p > appPrec) $+#endif+ fromString "ThreadId " <> showbPrec p (getThreadId t) {-# INLINE showbPrec #-} -- Temporary workaround until Trac #8281 is fixed
src/TextShow/Data/Ord.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-|@@ -14,12 +15,27 @@ -} module TextShow.Data.Ord () where -import GHC.Exts (Down)-import TextShow.TH.Internal (deriveTextShow, deriveTextShow1)+import GHC.Exts (Down(..)) --- | /Since: 2/-$(deriveTextShow ''Ordering)--- | /Since: 2/-$(deriveTextShow ''Down)+import TextShow.Classes ( TextShow(..), TextShow1(..)+ , showbPrec1, showbUnaryWith )+import TextShow.TH.Internal (deriveTextShow)++-- | This instance would be equivalent to a derived 'TextShow' instance+-- if the 'getDown' field were removed.+--+-- /Since: 2/+instance TextShow a => TextShow (Down a) where+ showbPrec = showbPrec1+ {-# INLINE showbPrec #-}++-- | This instance would be equivalent to a derived 'TextShow1' instance+-- if the 'getDown' field were removed.+--+-- /Since: 2/+instance TextShow1 Down where+ liftShowbPrec sp _ p (Down x) = showbUnaryWith sp "Down" p x+ {-# INLINE liftShowbPrec #-}+ -- | /Since: 2/-$(deriveTextShow1 ''Down)+$(deriveTextShow ''Ordering)
tests/Derived/TypeSynonyms.hs view
@@ -22,6 +22,8 @@ -} module Derived.TypeSynonyms (TyCon(..), TyFamily(..)) where +import Data.Orphans ()+ import qualified Generics.Deriving.TH as Generics import GHC.Generics (Generic)@@ -42,13 +44,6 @@ type FakeOut a = Int type Id a = a type Flip f a b = f b a--#if __GLASGOW_HASKELL__ < 809--- Needed for the Generic1 instances--- TODO: Obtain this instance from base-orphans instead-instance Functor ((,,,) a b c) where- fmap f (a, b, c, d) = (a, b, c, f d)-#endif -------------------------------------------------------------------------------
tests/Instances/GHC/RTS/Flags.hs view
@@ -91,8 +91,6 @@ type DoHeapProfile' = $(conT doHeapProfileTypeName) type DoTrace' = $(conT doTraceTypeName) --- TODO: Perhaps we should add deriving (Enum, Bounded) to deriving-compat--- and use that instead of Generic? instance Arbitrary GiveGCStats' where arbitrary = genericArbitrary
text-show.cabal view
@@ -1,5 +1,5 @@ name: text-show-version: 3.8.3+version: 3.8.4 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@@ -335,7 +335,7 @@ TextShow.TH.Names build-depends: array >= 0.3 && < 0.6 , base-compat-batteries >= 0.11 && < 0.12- , base-orphans >= 0.6 && < 0.9+ , base-orphans >= 0.8.2 && < 0.9 , bytestring >= 0.9 && < 0.11 , bytestring-builder , deriving-compat >= 0.5.6 && < 1