Hello community, here is the log from the commit of package ghc-aeson-compat for openSUSE:Factory checked in at 2018-07-24 17:12:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-aeson-compat (Old) and /work/SRC/openSUSE:Factory/.ghc-aeson-compat.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-aeson-compat" Tue Jul 24 17:12:38 2018 rev:13 rq:623709 version:0.3.8 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-aeson-compat/ghc-aeson-compat.changes 2018-05-30 12:23:07.218443342 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-aeson-compat.new/ghc-aeson-compat.changes 2018-07-24 17:12:42.322551053 +0200 @@ -1,0 +2,15 @@ +Wed Jul 18 14:26:12 UTC 2018 - [email protected] + +- Cosmetic: replace tabs with blanks, strip trailing white space, + and update copyright headers with spec-cleaner. + +------------------------------------------------------------------- +Fri Jul 13 14:32:03 UTC 2018 - [email protected] + +- Update aeson-compat to version 0.3.8. + # 0.3.8 + + - Re-implement `withNumber` + - Add `withEmbeddedJSON` + +------------------------------------------------------------------- @@ -91 +105,0 @@ - Old: ---- aeson-compat-0.3.7.1.tar.gz New: ---- aeson-compat-0.3.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-aeson-compat.spec ++++++ --- /var/tmp/diff_new_pack.uHr5F0/_old 2018-07-24 17:12:42.798551672 +0200 +++ /var/tmp/diff_new_pack.uHr5F0/_new 2018-07-24 17:12:42.802551677 +0200 @@ -19,14 +19,14 @@ %global pkg_name aeson-compat %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.3.7.1 +Version: 0.3.8 Release: 0 Summary: Compatibility layer for aeson License: BSD-3-Clause Group: Development/Libraries/Haskell URL: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz -Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/3.cabal#/%{pkg_name}.cabal +Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-aeson-devel BuildRequires: ghc-attoparsec-devel ++++++ aeson-compat-0.3.7.1.tar.gz -> aeson-compat-0.3.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-compat-0.3.7.1/CHANGELOG.md new/aeson-compat-0.3.8/CHANGELOG.md --- old/aeson-compat-0.3.7.1/CHANGELOG.md 2017-07-24 14:29:50.000000000 +0200 +++ new/aeson-compat-0.3.8/CHANGELOG.md 2018-06-12 11:55:37.000000000 +0200 @@ -1,3 +1,8 @@ +# 0.3.8 + +- Re-implement `withNumber` +- Add `withEmbeddedJSON` + # 0.3.7 - Use `attoparsec-iso8601` time parsers. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-compat-0.3.7.1/aeson-compat.cabal new/aeson-compat-0.3.8/aeson-compat.cabal --- old/aeson-compat-0.3.7.1/aeson-compat.cabal 2017-07-24 14:29:50.000000000 +0200 +++ new/aeson-compat-0.3.8/aeson-compat.cabal 2018-06-12 11:55:37.000000000 +0200 @@ -1,5 +1,5 @@ name: aeson-compat -version: 0.3.7.1 +version: 0.3.8 synopsis: Compatibility layer for aeson description: Compatibility layer for @aeson@ category: Web @@ -16,7 +16,8 @@ GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, - GHC==8.2.1 + GHC==8.2.2, + GHC==8.4.3 extra-source-files: CHANGELOG.md @@ -31,14 +32,14 @@ src ghc-options: -Wall build-depends: - base >=4.6 && <4.11 - , base-compat >=0.6.0 && <0.10 - , aeson >=0.7.0.6 && <1.3 + base >=4.6 && <4.12 + , base-compat >=0.6.0 && <0.11 + , aeson >=0.7.0.6 && <1.5 , attoparsec >=0.12 && <0.14 , attoparsec-iso8601 >=1.0.0.0 && <1.1 , bytestring >=0.10 && <0.11 , containers >=0.5 && <0.6 - , exceptions >=0.8 && <0.9 + , exceptions >=0.8 && <0.11 , hashable >=1.2 && <1.3 , scientific >=0.3 && <0.4 , text >=1.2 && <1.3 @@ -82,11 +83,11 @@ , vector , tagged , aeson-compat - , base-orphans >=0.4.5 && <0.7 - , tasty >=0.10 && <0.12 - , tasty-hunit >=0.9 && <0.10 - , tasty-quickcheck >=0.8 && <0.10 - , QuickCheck >=2.10 && <2.11 + , base-orphans >=0.4.5 && <0.8 + , tasty >=0.10 && <1.2 + , tasty-hunit >=0.9 && <0.11 + , tasty-quickcheck >=0.8 && <0.11 + , QuickCheck >=2.10 && <2.12 , quickcheck-instances >=0.3.16 && <0.4 if !impl(ghc >= 8.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-compat-0.3.7.1/src/Data/Aeson/Compat.hs new/aeson-compat-0.3.8/src/Data/Aeson/Compat.hs --- old/aeson-compat-0.3.7.1/src/Data/Aeson/Compat.hs 2017-07-24 14:29:50.000000000 +0200 +++ new/aeson-compat-0.3.8/src/Data/Aeson/Compat.hs 2018-06-12 11:55:37.000000000 +0200 @@ -74,6 +74,7 @@ withNumber, withScientific, withBool, + withEmbeddedJSON, -- * Constructors and accessors #if MIN_VERSION_aeson(0,10,0) Series, @@ -101,6 +102,9 @@ #if !MIN_VERSION_aeson (0,9,0) , eitherDecode, eitherDecode', eitherDecodeStrict, eitherDecodeStrict' #endif +#if !MIN_VERSION_aeson (1,4,0) + , withNumber +#endif ) import Data.Aeson.Parser (value, value') @@ -112,12 +116,13 @@ #endif import Control.Monad.Catch (MonadThrow (..), Exception) -import Data.Aeson.Types hiding ((.:?)) +import Data.Aeson.Types (Parser, modifyFailure, typeMismatch, defaultOptions) import Data.ByteString as B import qualified Data.Scientific as Scientific import Data.ByteString.Lazy as L import qualified Data.HashMap.Strict as H import Data.Text as T +import qualified Data.Text.Encoding as TE import Data.Typeable (Typeable) #if !MIN_VERSION_aeson(0,10,0) @@ -146,6 +151,8 @@ import qualified Data.Vector as V #endif +import Data.Attoparsec.Number (Number (..)) + -- | Exception thrown by 'decode' - family of functions in this module. newtype AesonException = AesonException String deriving (Show, Typeable) @@ -422,3 +429,32 @@ ne [] = fail "Expected a NonEmpty but got an empty list" ne (x:xs) = pure (x :| xs) #endif + +------------------------------------------------------------------------------- +-- with* +------------------------------------------------------------------------------- + +-- | @'withNumber' expected f value@ applies @f@ to the 'Number' when @value@ +-- is a 'Number' and fails using @'typeMismatch' expected@ otherwise. +withNumber :: String -> (Number -> Parser a) -> Value -> Parser a +withNumber expected f = withScientific expected (f . scientificToNumber) +{-# INLINE withNumber #-} +{-# DEPRECATED withNumber "Use withScientific instead" #-} + +scientificToNumber :: Scientific.Scientific -> Number +scientificToNumber s + | e < 0 || e > 1024 = D $ Scientific.toRealFloat s + | otherwise = I $ c * 10 ^ e + where + e = Scientific.base10Exponent s + c = Scientific.coefficient s +{-# INLINE scientificToNumber #-} + +#if !MIN_VERSION_aeson(1,2,3) +-- | Decode a nested JSON-encoded string. +withEmbeddedJSON :: String -> (Value -> Parser a) -> Value -> Parser a +withEmbeddedJSON _ innerParser (String txt) = + either fail innerParser $ eitherDecode (L.fromStrict $ TE.encodeUtf8 txt) +withEmbeddedJSON name _ v = typeMismatch name v +{-# INLINE withEmbeddedJSON #-} +#endif ++++++ aeson-compat.cabal ++++++ --- /var/tmp/diff_new_pack.uHr5F0/_old 2018-07-24 17:12:42.878551776 +0200 +++ /var/tmp/diff_new_pack.uHr5F0/_new 2018-07-24 17:12:42.878551776 +0200 @@ -1,6 +1,6 @@ name: aeson-compat -version: 0.3.7.1 -x-revision: 3 +version: 0.3.8 +x-revision: 1 synopsis: Compatibility layer for aeson description: Compatibility layer for @aeson@ category: Web @@ -18,7 +18,7 @@ GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, - GHC==8.4.1 + GHC==8.4.3 extra-source-files: CHANGELOG.md @@ -35,7 +35,7 @@ build-depends: base >=4.6 && <4.12 , base-compat >=0.6.0 && <0.11 - , aeson >=0.7.0.6 && <1.4 + , aeson >=0.7.0.6 && <1.5 , attoparsec >=0.12 && <0.14 , attoparsec-iso8601 >=1.0.0.0 && <1.1 , bytestring >=0.10 && <0.11 @@ -84,8 +84,8 @@ , vector , tagged , aeson-compat - , base-orphans >=0.4.5 && <0.8 - , tasty >=0.10 && <1.1 + , base-orphans >=0.4.5 && <0.9 + , tasty >=0.10 && <1.2 , tasty-hunit >=0.9 && <0.11 , tasty-quickcheck >=0.8 && <0.11 , QuickCheck >=2.10 && <2.12
