Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-http-api-data for 
openSUSE:Factory checked in at 2021-01-20 18:24:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-http-api-data (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-http-api-data.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-http-api-data"

Wed Jan 20 18:24:30 2021 rev:21 rq:862326 version:0.4.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-http-api-data/ghc-http-api-data.changes      
2020-12-22 11:40:54.809588204 +0100
+++ 
/work/SRC/openSUSE:Factory/.ghc-http-api-data.new.28504/ghc-http-api-data.changes
   2021-01-20 18:25:10.627389449 +0100
@@ -1,0 +2,10 @@
+Mon Jan  4 11:06:21 UTC 2021 - [email protected]
+
+- Update http-api-data to version 0.4.3.
+  0.4.3
+  -----
+
+  * Add `Quarter`, `QuarterOfYear` and `Month` instances
+  * Support `bytestring-0.11`
+
+-------------------------------------------------------------------

Old:
----
  http-api-data-0.4.2.tar.gz

New:
----
  http-api-data-0.4.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-http-api-data.spec ++++++
--- /var/tmp/diff_new_pack.pxPfey/_old  2021-01-20 18:25:12.603391359 +0100
+++ /var/tmp/diff_new_pack.pxPfey/_new  2021-01-20 18:25:12.607391363 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-http-api-data
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %global pkg_name http-api-data
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.4.2
+Version:        0.4.3
 Release:        0
 Summary:        Converting to/from HTTP API data like URL pieces, headers and 
query parameters
 License:        BSD-2-Clause
@@ -46,7 +46,6 @@
 BuildRequires:  ghc-HUnit-devel
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-hspec-devel
-BuildRequires:  ghc-nats-devel
 BuildRequires:  ghc-quickcheck-instances-devel
 %endif
 

++++++ http-api-data-0.4.2.tar.gz -> http-api-data-0.4.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-api-data-0.4.2/CHANGELOG.md 
new/http-api-data-0.4.3/CHANGELOG.md
--- old/http-api-data-0.4.2/CHANGELOG.md        2001-09-09 03:46:40.000000000 
+0200
+++ new/http-api-data-0.4.3/CHANGELOG.md        2001-09-09 03:46:40.000000000 
+0200
@@ -1,3 +1,9 @@
+0.4.3
+-----
+
+* Add `Quarter`, `QuarterOfYear` and `Month` instances
+* Support `bytestring-0.11`
+
 0.4.2
 -----
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-api-data-0.4.2/http-api-data.cabal 
new/http-api-data-0.4.3/http-api-data.cabal
--- old/http-api-data-0.4.2/http-api-data.cabal 2001-09-09 03:46:40.000000000 
+0200
+++ new/http-api-data-0.4.3/http-api-data.cabal 2001-09-09 03:46:40.000000000 
+0200
@@ -1,6 +1,6 @@
 cabal-version:   >= 1.10
 name:            http-api-data
-version:         0.4.2
+version:         0.4.3
 
 synopsis:        Converting to/from HTTP API data like URL pieces, headers and 
query parameters.
 category:        Web
@@ -31,7 +31,7 @@
   GHC==8.4.4,
   GHC==8.6.5,
   GHC==8.8.4,
-  GHC==8.10.2
+  GHC==8.10.3
 
 flag use-text-show
   description: Use text-show library for efficient ToHttpApiData 
implementations.
@@ -44,7 +44,7 @@
 
     -- GHC bundled
     build-depends:   base                  >= 4.7      && < 4.15
-                   , bytestring            >= 0.10.4.0 && < 0.11
+                   , bytestring            >= 0.10.4.0 && < 0.12
                    , containers            >= 0.5.5.1  && < 0.7
                    , text                  >= 1.2.3.0  && < 1.3
                    , transformers          >= 0.3      && < 0.6
@@ -56,15 +56,15 @@
     -- other-dependencies
     build-depends:
                      attoparsec            >= 0.13.2.2 && < 0.14
-                   , attoparsec-iso8601    >= 1.0.1.0  && < 1.1
+                   , attoparsec-iso8601    >= 1.0.2.0  && < 1.1
                    , base-compat           >= 0.10.5   && < 0.12
                    , cookie                >= 0.4.3    && < 0.5
                    , hashable              >= 1.2.7.0  && < 1.4
                    , http-types            >= 0.12.3   && < 0.13
                    , tagged                >= 0.8.5    && < 0.9
-                   , time-compat           >= 1.9.2    && < 1.10
-                   , unordered-containers  >= 0.2.10.0  && < 0.3
-                   , uuid-types            >= 1.0.3    && <1.1
+                   , time-compat           >= 1.9.5    && < 1.10
+                   , unordered-containers  >= 0.2.10.0 && < 0.3
+                   , uuid-types            >= 1.0.3    && < 1.1
 
     if !impl(ghc >= 7.10)
       build-depends:
@@ -104,16 +104,18 @@
                    , bytestring
                    , cookie
                    , http-api-data
-                   , nats
                    , text
                    , time-compat
                    , unordered-containers
                    , uuid-types
 
-    build-depends:   HUnit                >= 1.6.0.0 && <1.7
-                   , hspec                >= 2.7.1   && <2.8
-                   , QuickCheck           >= 2.13.1  && <2.15
-                   , quickcheck-instances >= 0.3.21  && <0.4
+    if !impl(ghc >= 7.10)
+      build-depends: nats
+
+    build-depends:   HUnit                >= 1.6.0.0  && <1.7
+                   , hspec                >= 2.7.1    && <2.8
+                   , QuickCheck           >= 2.13.1   && <2.15
+                   , quickcheck-instances >= 0.3.25.2 && <0.4
 
 source-repository head
   type:     git
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/http-api-data-0.4.2/src/Web/Internal/FormUrlEncoded.hs 
new/http-api-data-0.4.3/src/Web/Internal/FormUrlEncoded.hs
--- old/http-api-data-0.4.2/src/Web/Internal/FormUrlEncoded.hs  2001-09-09 
03:46:40.000000000 +0200
+++ new/http-api-data-0.4.3/src/Web/Internal/FormUrlEncoded.hs  2001-09-09 
03:46:40.000000000 +0200
@@ -52,6 +52,8 @@
 import qualified Data.Text.Lazy             as Lazy
 import           Data.Time.Compat           (Day, LocalTime, NominalDiffTime,
                                              UTCTime, ZonedTime)
+import           Data.Time.Calendar.Month.Compat (Month)
+import           Data.Time.Calendar.Quarter.Compat (Quarter, QuarterOfYear 
(..))
 import           Data.Void                  (Void)
 import           Data.Word                  (Word16, Word32, Word64, Word8)
 import           GHC.Exts                   (Constraint, IsList (..))
@@ -113,6 +115,9 @@
 instance ToFormKey ZonedTime        where toFormKey = toQueryParam
 instance ToFormKey UTCTime          where toFormKey = toQueryParam
 instance ToFormKey NominalDiffTime  where toFormKey = toQueryParam
+instance ToFormKey Quarter          where toFormKey = toQueryParam
+instance ToFormKey QuarterOfYear    where toFormKey = toQueryParam
+instance ToFormKey Month            where toFormKey = toQueryParam
 
 instance ToFormKey String     where toFormKey = toQueryParam
 instance ToFormKey Text       where toFormKey = toQueryParam
@@ -172,6 +177,9 @@
 instance FromFormKey ZonedTime        where parseFormKey = parseQueryParam
 instance FromFormKey UTCTime          where parseFormKey = parseQueryParam
 instance FromFormKey NominalDiffTime  where parseFormKey = parseQueryParam
+instance FromFormKey Quarter          where parseFormKey = parseQueryParam
+instance FromFormKey QuarterOfYear    where parseFormKey = parseQueryParam
+instance FromFormKey Month            where parseFormKey = parseQueryParam
 
 instance FromFormKey String     where parseFormKey = parseQueryParam
 instance FromFormKey Text       where parseFormKey = parseQueryParam
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-api-data-0.4.2/src/Web/Internal/HttpApiData.hs 
new/http-api-data-0.4.3/src/Web/Internal/HttpApiData.hs
--- old/http-api-data-0.4.2/src/Web/Internal/HttpApiData.hs     2001-09-09 
03:46:40.000000000 +0200
+++ new/http-api-data-0.4.3/src/Web/Internal/HttpApiData.hs     2001-09-09 
03:46:40.000000000 +0200
@@ -55,6 +55,9 @@
                                                secondsToNominalDiffTime)
 import           Data.Time.Format.Compat      (defaultTimeLocale,
                                                iso8601DateFormat)
+import           Data.Time.Calendar.Month.Compat (Month)
+import           Data.Time.Calendar.Quarter.Compat (Quarter, QuarterOfYear 
(..),
+                                               toYearQuarter)
 import           Data.Typeable                (Typeable)
 import qualified Data.UUID.Types              as UUID
 import           Data.Version                 (Version, parseVersion,
@@ -516,6 +519,42 @@
 
   toEncodedUrlPiece = unsafeToEncodedUrlPiece
 
+-- | 
+-- >>> toUrlPiece Q4
+-- "q4"
+instance ToHttpApiData QuarterOfYear where
+  toUrlPiece Q1 = "q1"
+  toUrlPiece Q2 = "q2"
+  toUrlPiece Q3 = "q3"
+  toUrlPiece Q4 = "q4"
+
+-- |
+-- >>> import Data.Time.Calendar.Quarter.Compat (Quarter (..))
+-- >>> MkQuarter 8040
+-- 2010-Q1
+--
+-- >>> toUrlPiece $ MkQuarter 8040
+-- "2010-q1"
+--
+instance ToHttpApiData Quarter where
+  toUrlPiece q = case toYearQuarter q of
+    (y, qoy) -> T.pack (show y ++ "-" ++ f qoy)
+    where
+      f Q1 = "q1"
+      f Q2 = "q2"
+      f Q3 = "q3"
+      f Q4 = "q4"
+
+-- |
+-- >>> import Data.Time.Calendar.Month.Compat (Month (..))
+-- >>> MkMonth 24482
+-- 2040-03
+--
+-- >>> toUrlPiece $ MkMonth 24482
+-- "2040-03"
+--
+instance ToHttpApiData Month where
+  toUrlPiece = T.pack . formatTime defaultTimeLocale "%Y-%m"
 
 instance ToHttpApiData NominalDiffTime where
   toUrlPiece = toUrlPiece . nominalDiffTimeToSeconds
@@ -704,6 +743,9 @@
 -- Right 2015-10-03 00:14:24 UTC
 instance FromHttpApiData UTCTime   where parseUrlPiece = runAtto Atto.utcTime
 
+-- |
+-- >>> parseUrlPiece "Monday" :: Either Text DayOfWeek
+-- Right Monday
 instance FromHttpApiData DayOfWeek where
   parseUrlPiece t = case Map.lookup (T.toLower t) m of
       Just dow -> Right dow
@@ -715,6 +757,30 @@
 
 instance FromHttpApiData NominalDiffTime where parseUrlPiece = fmap 
secondsToNominalDiffTime . parseUrlPiece
 
+-- |
+-- >>> parseUrlPiece "2021-01" :: Either Text Month
+-- Right 2021-01
+instance FromHttpApiData Month where parseUrlPiece = runAtto Atto.month
+
+-- |
+-- >>> parseUrlPiece "2021-q1" :: Either Text Quarter
+-- Right 2021-Q1
+instance FromHttpApiData Quarter where parseUrlPiece = runAtto Atto.quarter
+
+-- |
+-- >>> parseUrlPiece "q2" :: Either Text QuarterOfYear
+-- Right Q2
+--
+-- >>> parseUrlPiece "Q3" :: Either Text QuarterOfYear
+-- Right Q3
+instance FromHttpApiData QuarterOfYear where
+    parseUrlPiece t = case T.toLower t of
+        "q1"  -> return Q1
+        "q2"  -> return Q2
+        "q3"  -> return Q3
+        "q4"  -> return Q4
+        _     -> Left "Invalid quarter of year"
+
 instance FromHttpApiData All where parseUrlPiece = coerce (parseUrlPiece :: 
Text -> Either Text Bool)
 instance FromHttpApiData Any where parseUrlPiece = coerce (parseUrlPiece :: 
Text -> Either Text Bool)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/http-api-data-0.4.2/test/Web/Internal/HttpApiDataSpec.hs 
new/http-api-data-0.4.3/test/Web/Internal/HttpApiDataSpec.hs
--- old/http-api-data-0.4.2/test/Web/Internal/HttpApiDataSpec.hs        
2001-09-09 03:46:40.000000000 +0200
+++ new/http-api-data-0.4.3/test/Web/Internal/HttpApiDataSpec.hs        
2001-09-09 03:46:40.000000000 +0200
@@ -14,6 +14,8 @@
 import qualified Data.Text.Encoding         as TE
 import qualified Data.Text.Lazy             as L
 import           Data.Time.Compat
+import           Data.Time.Calendar.Month.Compat (Month)
+import           Data.Time.Calendar.Quarter.Compat (Quarter, QuarterOfYear 
(..))
 import qualified Data.UUID.Types            as UUID
 import           Data.Version
 import           Data.Word
@@ -87,6 +89,10 @@
     checkUrlPiece  (Proxy :: Proxy UTCTime)   "UTCTime"
     checkUrlPiece  (Proxy :: Proxy NominalDiffTime) "NominalDiffTime"
     checkUrlPiece  (Proxy :: Proxy DayOfWeek) "DayOfWeek"
+    checkUrlPiece  (Proxy :: Proxy Quarter)   "Quarter"
+    checkUrlPiece  (Proxy :: Proxy QuarterOfYear) "QuarterOfYear"
+    checkUrlPiece  (Proxy :: Proxy Month)     "Month"
+    checkUrlPiece  (Proxy :: Proxy DayOfWeek) "DayOfWeek"
     checkUrlPiece  (Proxy :: Proxy Version)   "Version"
     checkUrlPiece  (Proxy :: Proxy UUID.UUID) "UUID"
     checkUrlPiece' setCookieGen               "Cookie"

Reply via email to