packages feed

text-show-instances 3.8.5 → 3.8.6

raw patch · 10 files changed

+57/−73 lines, 10 filesdep +scientificdep ~quickcheck-instancesdep ~textPVP ok

version bump matches the API change (PVP)

Dependencies added: scientific

Dependency ranges changed: quickcheck-instances, text

API changes (from Hackage documentation)

+ TextShow.Data.Scientific: instance TextShow.Classes.TextShow Data.Scientific.Scientific

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+### 3.8.6 [2021.11.21]+* Add a `TextShow` instance for `Scientific` from the `scientific` package.+* Require `quickcheck-instances-0.3.27` or later in the test suite.+ ### 3.8.5 [2021.10.31] * Allow building with GHC 9.2. * Require `quickcheck-instances-0.3.26` or later in the test suite.
README.md view
@@ -29,6 +29,7 @@ * [`old-time`](http://hackage.haskell.org/package/old-time) * [`pretty`](http://hackage.haskell.org/package/pretty) * [`random`](http://hackage.haskell.org/package/random)+* [`scientific`](http://hackage.haskell.org/package/scientific) * [`tagged`](http://hackage.haskell.org/package/tagged) * [`template-haskell`](http://hackage.haskell.org/package/template-haskell) * [`terminfo`](http://hackage.haskell.org/package/terminfo)
+ src/TextShow/Data/Scientific.hs view
@@ -0,0 +1,12 @@+{-# OPTIONS -fno-warn-orphans #-}+module TextShow.Data.Scientific () where+import Data.Scientific+import Data.Text.Lazy.Builder.Scientific ( scientificBuilder )+import TextShow++instance TextShow Scientific where+        showbPrec d s+                | coefficient s < 0 = showbParen (d > prefixMinusPrec) (scientificBuilder s)+                | otherwise         = scientificBuilder s+                where prefixMinusPrec :: Int+                      prefixMinusPrec = 6
src/TextShow/Instances.hs view
@@ -29,6 +29,7 @@ import TextShow.Data.Binary                 () import TextShow.Data.Containers             () import TextShow.Data.Functor.Trans          ()+import TextShow.Data.Scientific             () import TextShow.Data.Tagged                 () import TextShow.Data.Time                   () import TextShow.Data.UnorderedContainers    ()
− tests/Instances/Control/Applicative/Trans.hs
@@ -1,44 +0,0 @@-{-# LANGUAGE CPP                        #-}-{-# LANGUAGE DeriveGeneric              #-}-{-# LANGUAGE FlexibleContexts           #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE StandaloneDeriving         #-}-{-# LANGUAGE TemplateHaskell            #-}-{-# LANGUAGE TypeFamilies               #-}-{-# OPTIONS_GHC -fno-warn-orphans #-}-{-|-Module:      Instances.Control.Applicative.Trans-Copyright:   (C) 2014-2017 Ryan Scott-License:     BSD-style (see the file LICENSE)-Maintainer:  Ryan Scott-Stability:   Provisional-Portability: GHC--Provides 'Arbitrary' instances for applicative functor transformers.--}-module Instances.Control.Applicative.Trans () where--import           Control.Applicative.Backwards (Backwards(..))-import           Control.Applicative.Lift      (Lift(..))-import           Control.Monad.Trans.Instances ()---- TODO: Remove the MIN_VERSION_transformers_compat(0,7,0) by unconditionally--- depending on transformers-0.7 or later-#if !(MIN_VERSION_transformers(0,6,0)) && !(MIN_VERSION_transformers_compat(0,7,0))-import           GHC.Generics (Generic)-#endif--import           Instances.Utils.GenericArbitrary (genericArbitrary)--import           Test.QuickCheck (Arbitrary(..))--deriving instance Arbitrary (f a) => Arbitrary (Backwards f a)--instance (Arbitrary a, Arbitrary (f a)) => Arbitrary (Lift f a) where-    arbitrary = genericArbitrary---- TODO: Remove the MIN_VERSION_transformers_compat(0,7,0) by unconditionally--- depending on transformers-0.7 or later-#if !(MIN_VERSION_transformers(0,6,0)) && !(MIN_VERSION_transformers_compat(0,7,0))-deriving instance Generic (Lift f a)-#endif
− tests/Instances/Data/Functor/Trans.hs
@@ -1,20 +0,0 @@-{-# LANGUAGE FlexibleContexts           #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE StandaloneDeriving         #-}-{-# OPTIONS_GHC -fno-warn-orphans #-}-{-|-Module:      Instances.Data.Functor.Trans-Copyright:   (C) 2014-2017 Ryan Scott-License:     BSD-style (see the file LICENSE)-Maintainer:  Ryan Scott-Stability:   Provisional-Portability: GHC--Provides 'Arbitrary' instances for functor transformers.--}-module Instances.Data.Functor.Trans () where--import Data.Functor.Reverse (Reverse(..))-import Test.QuickCheck (Arbitrary)--deriving instance Arbitrary (f a) => Arbitrary (Reverse f a)
tests/Spec/Control/Applicative/TransSpec.hs view
@@ -15,11 +15,10 @@  import Data.Proxy (Proxy(..)) -import Instances.Control.Applicative.Trans ()- import Spec.Utils (matchesTextShowSpec)  import Test.Hspec (Spec, describe, hspec, parallel)+import Test.QuickCheck.Instances ()  import TextShow.Control.Applicative.Trans () 
tests/Spec/Data/Functor/TransSpec.hs view
@@ -17,8 +17,6 @@ import Data.Functor.Sum      (Sum) import Data.Proxy            (Proxy(..)) -import Instances.Data.Functor.Trans ()- import Spec.Utils (matchesTextShowSpec)  import Test.Hspec (Spec, describe, hspec, parallel)
+ tests/Spec/Data/ScientificSpec.hs view
@@ -0,0 +1,29 @@+{-|+Module:      Spec.Data.ScientificSpec+Copyright:   (C) 2014-2018 Ryan Scott+License:     BSD-style (see the file LICENSE)+Maintainer:  Ryan Scott+Stability:   Provisional+Portability: GHC++@hspec@ tests for 'Scientific' (from the @scientific@ package).+-}+module Spec.Data.ScientificSpec (main, spec) where++import           Data.Proxy                (Proxy (..))+import           Data.Scientific           (Scientific)++import           Spec.Utils                (matchesTextShowSpec)++import           Test.Hspec                (Spec, describe, hspec, parallel)+import           Test.QuickCheck.Instances ()++import           TextShow.Data.Scientific   ()++main :: IO ()+main = hspec spec++spec :: Spec+spec = parallel $ do+    describe "Scientific" $+        matchesTextShowSpec (Proxy :: Proxy Scientific)
text-show-instances.cabal view
@@ -1,5 +1,5 @@ name:                text-show-instances-version:             3.8.5+version:             3.8.6 synopsis:            Additional instances for text-show description:         @text-show-instances@ is a supplemental library to @text-show@                      that provides additional @Show@ instances for data types in@@ -29,6 +29,8 @@                      .                      * @<http://hackage.haskell.org/package/random               random>@                      .+                     * @<http://hackage.haskell.org/package/scientific           scientific>@+                     .                      * @<http://hackage.haskell.org/package/tagged               tagged>@                      .                      * @<http://hackage.haskell.org/package/template-haskell     template-haskell>@@@ -105,6 +107,7 @@                        TextShow.Data.Binary                        TextShow.Data.Containers                        TextShow.Data.Functor.Trans+                       TextShow.Data.Scientific                        TextShow.Data.ShortText                        TextShow.Data.Tagged                        TextShow.Data.Time@@ -144,6 +147,7 @@                      , old-time              >= 1.1    && < 1.2                      , pretty                >= 1.1.1  && < 1.2                      , random                >= 1.0.1  && < 1.3+                     , scientific            >= 0.3.7  && < 0.4                      , semigroups            >= 0.16.2 && < 1                      , tagged                >= 0.4.4  && < 1                      , text                  >= 0.11.1 && < 1.3@@ -185,12 +189,10 @@ test-suite spec   type:                exitcode-stdio-1.0   main-is:             Spec.hs-  other-modules:       Instances.Control.Applicative.Trans-                       Instances.Control.Monad.Trans+  other-modules:       Instances.Control.Monad.Trans                        Instances.Data.Bifunctor                        Instances.Data.Binary                        Instances.Data.Containers-                       Instances.Data.Functor.Trans                        Instances.Data.Vector                        Instances.Language.Haskell.TH                        Instances.Miscellaneous@@ -226,6 +228,7 @@                        Spec.Data.BinarySpec                        Spec.Data.ContainersSpec                        Spec.Data.Functor.TransSpec+                       Spec.Data.ScientificSpec                        Spec.Data.ShortTextSpec                        Spec.Data.VectorSpec                        Spec.Data.TaggedSpec@@ -268,9 +271,10 @@                      , old-time              >= 1.1    && < 1.2                      , pretty                >= 1.1.1  && < 1.2                      , QuickCheck            >= 2.12   && < 2.15-                     , quickcheck-instances  >= 0.3.26 && < 0.4+                     , quickcheck-instances  >= 0.3.27 && < 0.4                      , random                >= 1.0.1  && < 1.3                      , tagged                >= 0.4.4  && < 1+                     , scientific            >= 0.3.7  && < 0.4                      , text-short            >= 0.1    && < 0.2                      , text-show             >= 3.4    && < 4                      , text-show-instances