Hello community, here is the log from the commit of package ghc-aeson for openSUSE:Factory checked in at 2018-10-25 08:14:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-aeson (Old) and /work/SRC/openSUSE:Factory/.ghc-aeson.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-aeson" Thu Oct 25 08:14:30 2018 rev:19 rq:642845 version:1.4.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-aeson/ghc-aeson.changes 2018-07-24 17:12:37.642544969 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-aeson.new/ghc-aeson.changes 2018-10-25 08:14:32.820117080 +0200 @@ -1,0 +2,14 @@ +Thu Oct 4 09:42:52 UTC 2018 - [email protected] + +- Update aeson to version 1.4.1.0. + #### 1.4.1.0 + + * Optimizations of generics, thanks to Rémy Oudompheng, here are some numbers for GHC 8.4: + * Compilation time: G/BigProduct.hs is 25% faster, G/BigRecord.hs is 2x faster. + * Runtime performance: BigRecord/toJSON/generic and BigProduct/encode/generic are more than 2x faster. + * Added To/FromJSON instances for `Void` and Generics's `V1`, thanks to Will Yager + * Added To/FromJSON instances for `primitive`'s `Array`, `SmallArray`, `PrimArray` and `UnliftedArray`, thanks to Andrew Thad. + * Fixes handling of `UTCTime` wrt. leap seconds , thanks to Adam Schønemann + * Warning and documentation fixes thanks to tom-bop, Gabor Greif, Ian Jeffries, and Mateusz Curyło. + +------------------------------------------------------------------- Old: ---- aeson-1.4.0.0.tar.gz New: ---- aeson-1.4.1.0.tar.gz aeson.cabal ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-aeson.spec ++++++ --- /var/tmp/diff_new_pack.UEYYwk/_old 2018-10-25 08:14:33.560116763 +0200 +++ /var/tmp/diff_new_pack.UEYYwk/_new 2018-10-25 08:14:33.564116761 +0200 @@ -12,20 +12,21 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %global pkg_name aeson %bcond_with tests Name: ghc-%{pkg_name} -Version: 1.4.0.0 +Version: 1.4.1.0 Release: 0 Summary: Fast JSON parsing and encoding 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/1.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-attoparsec-devel BuildRequires: ghc-base-compat-devel @@ -34,6 +35,7 @@ BuildRequires: ghc-deepseq-devel BuildRequires: ghc-dlist-devel BuildRequires: ghc-hashable-devel +BuildRequires: ghc-primitive-devel BuildRequires: ghc-rpm-macros BuildRequires: ghc-scientific-devel BuildRequires: ghc-tagged-devel @@ -81,6 +83,7 @@ %prep %setup -q -n %{pkg_name}-%{version} +cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ aeson-1.4.0.0.tar.gz -> aeson-1.4.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Encode.hs new/aeson-1.4.1.0/Data/Aeson/Encode.hs --- old/aeson-1.4.0.0/Data/Aeson/Encode.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Encode.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,3 +1,4 @@ +{-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: Data.Aeson.Encode -- Copyright: (c) 2012-2016 Bryan O'Sullivan @@ -8,13 +9,13 @@ -- Portability: portable -- -- This module is left to supply limited backwards-compatibility. + module Data.Aeson.Encode {-# DEPRECATED "Use Data.Aeson or Data.Aeson.Text instead" #-} ( encode , encodeToTextBuilder ) where -import Prelude () import Data.ByteString.Lazy (ByteString) import Data.Text.Lazy.Builder (Builder) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Encoding/Builder.hs new/aeson-1.4.1.0/Data/Aeson/Encoding/Builder.hs --- old/aeson-1.4.0.0/Data/Aeson/Encoding/Builder.hs 2018-06-09 11:39:03.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Encoding/Builder.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,5 +1,6 @@ {-# LANGUAGE BangPatterns #-} - +{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE TupleSections #-} -- | -- Module: Data.Aeson.Encoding.Builder -- Copyright: (c) 2011 MailRank, Inc. @@ -35,7 +36,6 @@ , ascii5 ) where -import Prelude () import Prelude.Compat import Data.Aeson.Internal.Time @@ -201,7 +201,7 @@ !(T mh ml) = twoDigits m !(T sh sl) = twoDigits (fromIntegral real) (real,frac) = s `quotRem` pico - showFrac = (\x -> ('.', x)) >$< (BP.liftFixedToBounded BP.char7 >*< trunc12) + showFrac = ('.',) >$< (BP.liftFixedToBounded BP.char7 >*< trunc12) trunc12 = (`quotRem` micro) >$< BP.condB (\(_,y) -> y == 0) (fst >$< trunc6) (digits6 >*< trunc6) digits6 = ((`quotRem` milli) . fromIntegral) >$< (digits3 >*< digits3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Encoding/Internal.hs new/aeson-1.4.1.0/Data/Aeson/Encoding/Internal.hs --- old/aeson-1.4.0.0/Data/Aeson/Encoding/Internal.hs 2017-10-26 16:26:50.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Encoding/Internal.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,7 +1,9 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE EmptyDataDecls #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} + module Data.Aeson.Encoding.Internal ( -- * Encoding @@ -55,7 +57,6 @@ , comma, colon, openBracket, closeBracket, openCurly, closeCurly ) where -import Prelude () import Prelude.Compat import Data.Aeson.Types.Internal (Value) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Encoding.hs new/aeson-1.4.1.0/Data/Aeson/Encoding.hs --- old/aeson-1.4.0.0/Data/Aeson/Encoding.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Encoding.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,8 +1,10 @@ +{-# LANGUAGE NoImplicitPrelude #-} -- | -- -- Functions in this module return well-formed 'Encoding''. -- Polymorphic variants, which return @'Encoding' a@, return a textual JSON -- value, so it can be used as both @'Encoding'' 'Text'@ and @'Encoding' = 'Encoding'' 'Value'@. + module Data.Aeson.Encoding ( -- * Encoding @@ -49,6 +51,5 @@ , value ) where -import Prelude () import Data.Aeson.Encoding.Internal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Internal/Functions.hs new/aeson-1.4.1.0/Data/Aeson/Internal/Functions.hs --- old/aeson-1.4.0.0/Data/Aeson/Internal/Functions.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Internal/Functions.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,3 +1,4 @@ +{-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: Data.Aeson.Functions -- Copyright: (c) 2011-2016 Bryan O'Sullivan @@ -14,7 +15,6 @@ , mapKey ) where -import Prelude () import Prelude.Compat import Data.Hashable (Hashable) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Internal.hs new/aeson-1.4.1.0/Data/Aeson/Internal.hs --- old/aeson-1.4.0.0/Data/Aeson/Internal.hs 2017-11-20 15:58:29.000000000 +0100 +++ new/aeson-1.4.1.0/Data/Aeson/Internal.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,3 +1,4 @@ +{-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: Data.Aeson.Internal -- Copyright: (c) 2015-2016 Bryan O'Sullivan @@ -22,7 +23,6 @@ , iparse ) where -import Prelude () import Data.Aeson.Types.Internal import Data.Aeson.Types.FromJSON (ifromJSON) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Parser/Internal.hs new/aeson-1.4.1.0/Data/Aeson/Parser/Internal.hs --- old/aeson-1.4.0.0/Data/Aeson/Parser/Internal.hs 2017-11-20 15:58:29.000000000 +0100 +++ new/aeson-1.4.1.0/Data/Aeson/Parser/Internal.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,10 +1,10 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} #if MIN_VERSION_ghc_prim(0,3,1) {-# LANGUAGE MagicHash #-} #endif - -- | -- Module: Data.Aeson.Parser.Internal -- Copyright: (c) 2011-2016 Bryan O'Sullivan @@ -35,7 +35,6 @@ , eitherDecodeStrictWith ) where -import Prelude () import Prelude.Compat import Control.Applicative ((<|>)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Parser/Time.hs new/aeson-1.4.1.0/Data/Aeson/Parser/Time.hs --- old/aeson-1.4.0.0/Data/Aeson/Parser/Time.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Parser/Time.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,3 +1,5 @@ +{-# LANGUAGE NoImplicitPrelude #-} + module Data.Aeson.Parser.Time ( run @@ -9,7 +11,6 @@ , zonedTime ) where -import Prelude () import Prelude.Compat import Data.Attoparsec.Text (Parser) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Parser.hs new/aeson-1.4.1.0/Data/Aeson/Parser.hs --- old/aeson-1.4.0.0/Data/Aeson/Parser.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Parser.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,3 +1,4 @@ +{-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: Data.Aeson.Parser -- Copyright: (c) 2012-2016 Bryan O'Sullivan @@ -45,7 +46,6 @@ , eitherDecodeStrictWith ) where -import Prelude () import Data.Aeson.Parser.Internal (decodeStrictWith, decodeWith, eitherDecodeStrictWith, eitherDecodeWith, json, json', jstring, scientific, value, value') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/TH.hs new/aeson-1.4.1.0/Data/Aeson/TH.hs --- old/aeson-1.4.0.0/Data/Aeson/TH.hs 2018-01-08 15:55:11.000000000 +0100 +++ new/aeson-1.4.1.0/Data/Aeson/TH.hs 2018-09-24 03:51:45.000000000 +0200 @@ -116,7 +116,6 @@ , mkLiftParseJSON2 ) where -import Prelude () import Prelude.Compat import Control.Applicative ((<|>)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Text.hs new/aeson-1.4.1.0/Data/Aeson/Text.hs --- old/aeson-1.4.0.0/Data/Aeson/Text.hs 2018-04-27 17:19:32.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Text.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,4 +1,5 @@ {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} -- | -- Module: Data.Aeson.Text @@ -14,13 +15,13 @@ -- -- You can use the conversions to 'Builder's when embedding JSON messages as -- parts of a protocol. + module Data.Aeson.Text ( encodeToLazyText , encodeToTextBuilder ) where -import Prelude () import Prelude.Compat import Data.Aeson.Types (Value(..), ToJSON(..)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Types/Class.hs new/aeson-1.4.1.0/Data/Aeson/Types/Class.hs --- old/aeson-1.4.0.0/Data/Aeson/Types/Class.hs 2018-06-08 15:26:50.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Types/Class.hs 2018-09-24 03:51:45.000000000 +0200 @@ -4,6 +4,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeSynonymInstances #-} @@ -91,7 +92,6 @@ , (.!=) ) where -import Prelude () import Data.Aeson.Types.FromJSON import Data.Aeson.Types.Generic (One, Zero) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Types/FromJSON.hs new/aeson-1.4.1.0/Data/Aeson/Types/FromJSON.hs --- old/aeson-1.4.0.0/Data/Aeson/Types/FromJSON.hs 2018-06-10 13:16:03.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Types/FromJSON.hs 2018-09-24 03:51:45.000000000 +0200 @@ -6,6 +6,7 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -76,7 +77,6 @@ , parseOptionalFieldWith ) where -import Prelude () import Prelude.Compat import Control.Applicative ((<|>), Const(..)) @@ -107,6 +107,7 @@ import Data.Traversable as Tr (sequence) import Data.Vector (Vector) import Data.Version (Version, parseVersion) +import Data.Void (Void) import Data.Word (Word16, Word32, Word64, Word8) import Foreign.Storable (Storable) import Foreign.C.Types (CTime (..)) @@ -139,6 +140,16 @@ import qualified Data.Vector.Storable as VS import qualified Data.Vector.Unboxed as VU +import qualified GHC.Exts as Exts +import qualified Data.Primitive.Array as PM +import qualified Data.Primitive.SmallArray as PM +import qualified Data.Primitive.Types as PM + +#if MIN_VERSION_primitive(0,6,4) +import qualified Data.Primitive.UnliftedArray as PM +import qualified Data.Primitive.PrimArray as PM +#endif + #ifndef HAS_COERCIBLE #define HAS_COERCIBLE (__GLASGOW_HASKELL__ >= 707) #endif @@ -657,7 +668,7 @@ -- when @value@ is a 'Number' and fails using @'typeMismatch' expected@ -- otherwise. -- --- The conversion will also fail wyth a @'typeMismatch' if the +-- The conversion will also fail with a @'typeMismatch' if the -- 'Scientific' exponent is larger than 1024. withBoundedScientific :: String -> (Scientific -> Parser a) -> Value -> Parser a withBoundedScientific _ f v@(Number scientific) = @@ -786,6 +797,11 @@ -- Generic parseJSON ------------------------------------------------------------------------------- +instance GFromJSON arity V1 where + -- Whereof we cannot format, thereof we cannot parse: + gParseJSON _ _ _ = fail "Attempted to parse empty type" + + instance OVERLAPPABLE_ (GFromJSON arity a) => GFromJSON arity (M1 i c a) where -- Meta-information, which is not handled elsewhere, is just added to the -- parsed value: @@ -1198,7 +1214,9 @@ parseJSON = parseJSON2 {-# INLINE parseJSON #-} - +instance FromJSON Void where + parseJSON _ = fail "Cannot parse Void" + {-# INLINE parseJSON #-} instance FromJSON Bool where parseJSON = withBool "Bool" pure @@ -1674,6 +1692,28 @@ {-# INLINE parseJSON #-} ------------------------------------------------------------------------------- +-- primitive +------------------------------------------------------------------------------- + +#if MIN_VERSION_base(4,7,0) +instance FromJSON a => FromJSON (PM.Array a) where + -- note: we could do better than this if vector exposed the data + -- constructor in Data.Vector. + parseJSON = fmap Exts.fromList . parseJSON + +instance FromJSON a => FromJSON (PM.SmallArray a) where + parseJSON = fmap Exts.fromList . parseJSON + +#if MIN_VERSION_primitive(0,6,4) +instance (PM.Prim a,FromJSON a) => FromJSON (PM.PrimArray a) where + parseJSON = fmap Exts.fromList . parseJSON + +instance (PM.PrimUnlifted a,FromJSON a) => FromJSON (PM.UnliftedArray a) where + parseJSON = fmap Exts.fromList . parseJSON +#endif +#endif + +------------------------------------------------------------------------------- -- time ------------------------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Types/Generic.hs new/aeson-1.4.1.0/Data/Aeson/Types/Generic.hs --- old/aeson-1.4.0.0/Data/Aeson/Types/Generic.hs 2018-03-30 03:38:10.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Types/Generic.hs 2018-09-24 03:51:45.000000000 +0200 @@ -5,6 +5,7 @@ {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} @@ -25,7 +26,7 @@ module Data.Aeson.Types.Generic ( - IsRecord(..) + IsRecord , AllNullary , Tagged2(..) , True @@ -36,7 +37,6 @@ , ProductSize(..) ) where -import Prelude () import Prelude.Compat import GHC.Generics diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Types/Internal.hs new/aeson-1.4.1.0/Data/Aeson/Types/Internal.hs --- old/aeson-1.4.0.0/Data/Aeson/Types/Internal.hs 2018-06-08 12:41:29.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Types/Internal.hs 2018-09-24 03:51:45.000000000 +0200 @@ -2,6 +2,7 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE Rank2Types #-} #if __GLASGOW_HASKELL__ >= 800 -- a) THQ works on cross-compilers and unregisterised GHCs @@ -74,7 +75,6 @@ , DotNetTime(..) ) where -import Prelude () import Prelude.Compat import Control.Applicative (Alternative(..)) @@ -331,8 +331,7 @@ apP :: Parser (a -> b) -> Parser a -> Parser b apP d e = do b <- d - a <- e - return (b a) + b <$> e {-# INLINE apP #-} -- | A JSON \"object\" (key\/value map). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Types/ToJSON.hs new/aeson-1.4.1.0/Data/Aeson/Types/ToJSON.hs --- old/aeson-1.4.0.0/Data/Aeson/Types/ToJSON.hs 2018-04-27 17:19:32.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Types/ToJSON.hs 2018-09-24 03:51:45.000000000 +0200 @@ -7,6 +7,7 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE RecordWildCards #-} @@ -58,7 +59,6 @@ , listValue ) where -import Prelude () import Prelude.Compat import Control.Applicative (Const(..)) @@ -66,7 +66,7 @@ import Data.Aeson.Encoding (Encoding, Encoding', Series, dict, emptyArray_) import Data.Aeson.Encoding.Internal ((>*<)) import Data.Aeson.Internal.Functions (mapHashKeyVal, mapKeyVal) -import Data.Aeson.Types.Generic (AllNullary, False, IsRecord(..), One, ProductSize, Tagged2(..), True, Zero, productSize) +import Data.Aeson.Types.Generic (AllNullary, False, IsRecord, One, ProductSize, Tagged2(..), True, Zero, productSize) import Data.Aeson.Types.Internal import Data.Attoparsec.Number (Number(..)) import Data.Bits (unsafeShiftR) @@ -91,6 +91,7 @@ import Data.Time.Locale.Compat (defaultTimeLocale) import Data.Vector (Vector) import Data.Version (Version, showVersion) +import Data.Void (Void, absurd) import Data.Word (Word16, Word32, Word64, Word8) import Foreign.Storable (Storable) import Foreign.C.Types (CTime (..)) @@ -127,6 +128,16 @@ import qualified Data.Aeson.Encoding.Builder as EB import qualified Data.ByteString.Builder as B +import qualified GHC.Exts as Exts +import qualified Data.Primitive.Array as PM +import qualified Data.Primitive.SmallArray as PM +import qualified Data.Primitive.Types as PM + +#if MIN_VERSION_primitive(0,6,4) +import qualified Data.Primitive.UnliftedArray as PM +import qualified Data.Primitive.PrimArray as PM +#endif + #if !(MIN_VERSION_bytestring(0,10,0)) import Foreign.ForeignPtr (withForeignPtr) import Foreign.Marshal.Utils (copyBytes) @@ -264,7 +275,7 @@ -- @ -- -- Previous versions of this library only had the 'toJSON' method. Adding --- 'toEncoding' had to reasons: +-- 'toEncoding' had two reasons: -- -- 1. toEncoding is more efficient for the common case that the output of -- 'toJSON' is directly serialized to a @ByteString@. @@ -657,11 +668,13 @@ instance OVERLAPPABLE_ (GToJSON enc arity a) => GToJSON enc arity (M1 i c a) where -- Meta-information, which is not handled elsewhere, is ignored: gToJSON opts targs = gToJSON opts targs . unM1 + {-# INLINE gToJSON #-} instance GToJSON enc One Par1 where -- Direct occurrences of the last type parameter are encoded with the -- function passed in as an argument: gToJSON _opts (To1Args tj _) = tj . unPar1 + {-# INLINE gToJSON #-} instance ( ConsToJSON enc arity a , AllNullary (C1 c a) allNullary @@ -674,11 +687,13 @@ . sumToJSON opts targs . unM1 | otherwise = consToJSON opts targs . unM1 . unM1 + {-# INLINE gToJSON #-} instance (ConsToJSON enc arity a) => GToJSON enc arity (C1 c a) where -- Constructors need to be encoded differently depending on whether they're -- a record or not. This distinction is made by 'consToJSON': gToJSON opts targs = consToJSON opts targs . unM1 + {-# INLINE gToJSON #-} instance ( AllNullary (a :+: b) allNullary , SumToJSON enc arity (a :+: b) allNullary @@ -689,6 +704,7 @@ -- strings. This distinction is made by 'sumToJSON': gToJSON opts targs = (unTagged :: Tagged allNullary enc -> enc) . sumToJSON opts targs + {-# INLINE gToJSON #-} -------------------------------------------------------------------------------- -- Generic toJSON @@ -697,18 +713,27 @@ -- possible but makes error messages a bit harder to understand for missing -- instances. +instance GToJSON Value arity V1 where + -- Empty values do not exist, which makes the job of formatting them + -- rather easy: + gToJSON _ _ x = x `seq` error "case: V1" + {-# INLINE gToJSON #-} + instance ToJSON a => GToJSON Value arity (K1 i a) where -- Constant values are encoded using their ToJSON instance: gToJSON _opts _ = toJSON . unK1 + {-# INLINE gToJSON #-} instance ToJSON1 f => GToJSON Value One (Rec1 f) where -- Recursive occurrences of the last type parameter are encoded using their -- ToJSON1 instance: gToJSON _opts (To1Args tj tjl) = liftToJSON tj tjl . unRec1 + {-# INLINE gToJSON #-} instance GToJSON Value arity U1 where -- Empty constructors are encoded to an empty array: gToJSON _opts _ _ = emptyArray + {-# INLINE gToJSON #-} instance ( WriteProduct arity a, WriteProduct arity b , ProductSize a, ProductSize b @@ -725,6 +750,7 @@ where lenProduct = (unTagged2 :: Tagged2 (a :*: b) Int -> Int) productSize + {-# INLINE gToJSON #-} instance ( ToJSON1 f , GToJSON Value One g @@ -736,6 +762,7 @@ gToJSON opts targs = let gtj = gToJSON opts targs in liftToJSON gtj (listValue gtj) . unComp1 + {-# INLINE gToJSON #-} -------------------------------------------------------------------------------- -- Generic toEncoding @@ -743,15 +770,18 @@ instance ToJSON a => GToJSON Encoding arity (K1 i a) where -- Constant values are encoded using their ToJSON instance: gToJSON _opts _ = toEncoding . unK1 + {-# INLINE gToJSON #-} instance ToJSON1 f => GToJSON Encoding One (Rec1 f) where -- Recursive occurrences of the last type parameter are encoded using their -- ToEncoding1 instance: gToJSON _opts (To1Args te tel) = liftToEncoding te tel . unRec1 + {-# INLINE gToJSON #-} instance GToJSON Encoding arity U1 where -- Empty constructors are encoded to an empty array: gToJSON _opts _ _ = E.emptyArray_ + {-# INLINE gToJSON #-} instance ( EncodeProduct arity a , EncodeProduct arity b @@ -761,6 +791,7 @@ -- the same size as the product and write the product's elements to it using -- 'encodeProduct': gToJSON opts targs p = E.list E.retagEncoding [encodeProduct opts targs p] + {-# INLINE gToJSON #-} instance ( ToJSON1 f , GToJSON Encoding One g @@ -772,6 +803,7 @@ gToJSON opts targs = let gte = gToJSON opts targs in liftToEncoding gte (listEncoding gte) . unComp1 + {-# INLINE gToJSON #-} -------------------------------------------------------------------------------- @@ -983,6 +1015,7 @@ ) => ConsToJSON' enc arity f True where consToJSON' opts targs = Tagged . fromPairs . recordToPairs opts targs + {-# INLINE consToJSON' #-} instance GToJSON enc arity f => ConsToJSON' enc arity f False where consToJSON' opts targs = Tagged . gToJSON opts targs @@ -1074,10 +1107,12 @@ lenL = len `unsafeShiftR` 1 lenR = len - lenL ixR = ix + lenL + {-# INLINE writeProduct #-} instance OVERLAPPABLE_ (GToJSON Value arity a) => WriteProduct arity a where writeProduct opts targs mv ix _ = VM.unsafeWrite mv ix . gToJSON opts targs + {-# INLINE writeProduct #-} -------------------------------------------------------------------------------- @@ -1095,9 +1130,11 @@ encodeProduct opts targs (a :*: b) = encodeProduct opts targs a >*< encodeProduct opts targs b + {-# INLINE encodeProduct #-} instance OVERLAPPABLE_ (GToJSON Encoding arity a) => EncodeProduct arity a where encodeProduct opts targs a = E.retagEncoding $ gToJSON opts targs a + {-# INLINE encodeProduct #-} -------------------------------------------------------------------------------- @@ -1201,6 +1238,13 @@ toEncoding = toEncoding2 {-# INLINE toEncoding #-} +instance ToJSON Void where + toJSON = absurd + {-# INLINE toJSON #-} + + toEncoding = absurd + {-# INLINE toEncoding #-} + instance ToJSON Bool where toJSON = Bool @@ -1885,6 +1929,32 @@ formatMillis = take 3 . formatTime defaultTimeLocale "%q" ------------------------------------------------------------------------------- +-- primitive +------------------------------------------------------------------------------- + +#if MIN_VERSION_base(4,7,0) +instance ToJSON a => ToJSON (PM.Array a) where + -- note: we could do better than this if vector exposed the data + -- constructor in Data.Vector. + toJSON = toJSON . Exts.toList + toEncoding = toEncoding . Exts.toList + +instance ToJSON a => ToJSON (PM.SmallArray a) where + toJSON = toJSON . Exts.toList + toEncoding = toEncoding . Exts.toList + +#if (MIN_VERSION_primitive(0,6,4)) +instance (PM.Prim a,ToJSON a) => ToJSON (PM.PrimArray a) where + toJSON = toJSON . Exts.toList + toEncoding = toEncoding . Exts.toList + +instance (PM.PrimUnlifted a,ToJSON a) => ToJSON (PM.UnliftedArray a) where + toJSON = toJSON . Exts.toList + toEncoding = toEncoding . Exts.toList +#endif +#endif + +------------------------------------------------------------------------------- -- time ------------------------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson/Types.hs new/aeson-1.4.1.0/Data/Aeson/Types.hs --- old/aeson-1.4.0.0/Data/Aeson/Types.hs 2018-06-08 15:27:00.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson/Types.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,3 +1,4 @@ +{-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: Data.Aeson.Types -- Copyright: (c) 2011-2016 Bryan O'Sullivan @@ -124,7 +125,6 @@ , defaultTaggedObject ) where -import Prelude () import Prelude.Compat import Data.Aeson.Encoding (Encoding, unsafeToEncoding, fromEncoding, Series, pairs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/Data/Aeson.hs new/aeson-1.4.1.0/Data/Aeson.hs --- old/aeson-1.4.0.0/Data/Aeson.hs 2018-06-08 15:27:06.000000000 +0200 +++ new/aeson-1.4.1.0/Data/Aeson.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,3 +1,4 @@ +{-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: Data.Aeson -- Copyright: (c) 2011-2016 Bryan O'Sullivan @@ -130,7 +131,6 @@ , json' ) where -import Prelude () import Prelude.Compat import Data.Aeson.Types.FromJSON (ifromJSON) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/aeson.cabal new/aeson-1.4.1.0/aeson.cabal --- old/aeson-1.4.0.0/aeson.cabal 2018-06-09 11:55:47.000000000 +0200 +++ new/aeson-1.4.1.0/aeson.cabal 2018-09-24 03:51:45.000000000 +0200 @@ -1,5 +1,5 @@ name: aeson -version: 1.4.0.0 +version: 1.4.1.0 license: BSD3 license-file: LICENSE category: Text, Web, JSON @@ -108,6 +108,7 @@ dlist >= 0.6, ghc-prim >= 0.2, hashable >= 1.1.2.0, + primitive >= 0.6.1, scientific >= 0.3.4.7 && < 0.4, tagged >=0.8.3 && <0.9, template-haskell >= 2.7, @@ -135,7 +136,8 @@ if !impl(ghc >= 7.10) -- `Numeric.Natural` is available in base only since GHC 7.10 / base 4.8 - build-depends: nats >= 1 && < 1.2 + build-depends: nats >= 1 && < 1.2, + void >= 0.7.2 && < 0.8 ghc-options: -Wall @@ -227,7 +229,8 @@ transformers-compat >= 0.3 if !impl(ghc >= 7.10) - build-depends: nats >=1 && <1.2 + build-depends: nats >=1 && <1.2, + void >=0.7.2 && <0.8 if impl(ghc >= 7.8) build-depends: hashable-time >= 0.2 && <0.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/attoparsec-iso8601/Data/Attoparsec/Time/Internal.hs new/aeson-1.4.1.0/attoparsec-iso8601/Data/Attoparsec/Time/Internal.hs --- old/aeson-1.4.0.0/attoparsec-iso8601/Data/Attoparsec/Time/Internal.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/attoparsec-iso8601/Data/Attoparsec/Time/Internal.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,5 +1,5 @@ {-# LANGUAGE CPP #-} - +{-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: Data.Aeson.Internal.Time -- Copyright: (c) 2015-2016 Bryan O'Sullivan @@ -17,17 +17,37 @@ , toTimeOfDay64 ) where -import Prelude () import Prelude.Compat import Data.Int (Int64) import Data.Time import Unsafe.Coerce (unsafeCoerce) +#if MIN_VERSION_time(1,6,0) + +import Data.Time.Clock (diffTimeToPicoseconds) + +#endif + #if MIN_VERSION_base(4,7,0) import Data.Fixed (Pico, Fixed(MkFixed)) +#else + +import Data.Fixed (Pico) + +#endif + +#if !MIN_VERSION_time(1,6,0) + +diffTimeToPicoseconds :: DiffTime -> Integer +diffTimeToPicoseconds = unsafeCoerce + +#endif + +#if MIN_VERSION_base(4,7,0) + toPico :: Integer -> Pico toPico = MkFixed @@ -36,8 +56,6 @@ #else -import Data.Fixed (Pico) - toPico :: Integer -> Pico toPico = unsafeCoerce @@ -51,11 +69,16 @@ {-# UNPACK #-} !Int {-# UNPACK #-} !Int64 +posixDayLength :: DiffTime +posixDayLength = 86400 + diffTimeOfDay64 :: DiffTime -> TimeOfDay64 -diffTimeOfDay64 t = TOD (fromIntegral h) (fromIntegral m) s - where (h,mp) = fromIntegral pico `quotRem` 3600000000000000 - (m,s) = mp `quotRem` 60000000000000 - pico = unsafeCoerce t :: Integer +diffTimeOfDay64 t + | t >= posixDayLength = TOD 23 59 (60000000000000 + pico (t - posixDayLength)) + | otherwise = TOD (fromIntegral h) (fromIntegral m) s + where (h,mp) = pico t `quotRem` 3600000000000000 + (m,s) = mp `quotRem` 60000000000000 + pico = fromIntegral . diffTimeToPicoseconds toTimeOfDay64 :: TimeOfDay -> TimeOfDay64 toTimeOfDay64 (TimeOfDay h m s) = TOD h m (fromIntegral (fromPico s)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/attoparsec-iso8601/Data/Attoparsec/Time.hs new/aeson-1.4.1.0/attoparsec-iso8601/Data/Attoparsec/Time.hs --- old/aeson-1.4.0.0/attoparsec-iso8601/Data/Attoparsec/Time.hs 2018-06-08 12:41:22.000000000 +0200 +++ new/aeson-1.4.1.0/attoparsec-iso8601/Data/Attoparsec/Time.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,6 +1,6 @@ {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} - -- | -- Module: Data.Aeson.Parser.Time -- Copyright: (c) 2015-2016 Bryan O'Sullivan @@ -21,7 +21,6 @@ , zonedTime ) where -import Prelude () import Prelude.Compat import Control.Applicative ((<|>)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/AesonEncode.hs new/aeson-1.4.1.0/benchmarks/AesonEncode.hs --- old/aeson-1.4.0.0/benchmarks/AesonEncode.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/benchmarks/AesonEncode.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,9 +1,9 @@ {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Main (main) where -import Prelude () import Prelude.Compat import Control.DeepSeq diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/AesonFoldable.hs new/aeson-1.4.1.0/benchmarks/AesonFoldable.hs --- old/aeson-1.4.0.0/benchmarks/AesonFoldable.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/benchmarks/AesonFoldable.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,10 +1,10 @@ +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Main (main) where import Criterion.Main -import Prelude () import Prelude.Compat import Data.Foldable (toList) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/AesonMap.hs new/aeson-1.4.1.0/benchmarks/AesonMap.hs --- old/aeson-1.4.0.0/benchmarks/AesonMap.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/benchmarks/AesonMap.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,11 +1,11 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RankNTypes #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Main (main) where -import Prelude () import Prelude.Compat import Control.DeepSeq diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/AesonParse.hs new/aeson-1.4.1.0/benchmarks/AesonParse.hs --- old/aeson-1.4.0.0/benchmarks/AesonParse.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/benchmarks/AesonParse.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,9 +1,9 @@ {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Main (main) where -import Prelude () import Prelude.Compat import Data.Aeson diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/AesonTuples.hs new/aeson-1.4.1.0/benchmarks/AesonTuples.hs --- old/aeson-1.4.0.0/benchmarks/AesonTuples.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/benchmarks/AesonTuples.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,6 +1,7 @@ +{-# LANGUAGE NoImplicitPrelude #-} + module Main (main) where -import Prelude () import Prelude.Compat import Control.DeepSeq (deepseq) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/Compare/BufferBuilder.hs new/aeson-1.4.1.0/benchmarks/Compare/BufferBuilder.hs --- old/aeson-1.4.0.0/benchmarks/Compare/BufferBuilder.hs 2018-06-08 12:41:29.000000000 +0200 +++ new/aeson-1.4.1.0/benchmarks/Compare/BufferBuilder.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,3 +1,4 @@ +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} @@ -6,7 +7,6 @@ module Compare.BufferBuilder () where -import Prelude () import Prelude.Compat hiding ((<>)) import Data.BufferBuilder.Json diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/Compare/JsonBench.hs new/aeson-1.4.1.0/benchmarks/Compare/JsonBench.hs --- old/aeson-1.4.0.0/benchmarks/Compare/JsonBench.hs 2018-06-08 12:41:29.000000000 +0200 +++ new/aeson-1.4.1.0/benchmarks/Compare/JsonBench.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,16 +1,16 @@ --- Adapted from a buffer-builder benchmark: --- --- https://github.com/chadaustin/buffer-builder/blob/master/test.json - {-# LANGUAGE BangPatterns #-} {-# LANGUAGE MagicHash #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} +-- Adapted from a buffer-builder benchmark: +-- +-- https://github.com/chadaustin/buffer-builder/blob/master/test.json + module Compare.JsonBench (benchmarks) where -import Prelude () import Prelude.Compat hiding ((<>)) import Control.DeepSeq (NFData(..)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/Compare/JsonBuilder.hs new/aeson-1.4.1.0/benchmarks/Compare/JsonBuilder.hs --- old/aeson-1.4.0.0/benchmarks/Compare/JsonBuilder.hs 2018-06-08 12:41:29.000000000 +0200 +++ new/aeson-1.4.1.0/benchmarks/Compare/JsonBuilder.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,3 +1,4 @@ +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} @@ -5,7 +6,6 @@ module Compare.JsonBuilder () where -import Prelude () import Prelude.Compat hiding ((<>)) import Data.Json.Builder diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/Compare.hs new/aeson-1.4.1.0/benchmarks/Compare.hs --- old/aeson-1.4.0.0/benchmarks/Compare.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/benchmarks/Compare.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,8 +1,8 @@ +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} module Main (main) where -import Prelude () import Prelude.Compat import Compare.BufferBuilder () diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/CompareWithJSON.hs new/aeson-1.4.1.0/benchmarks/CompareWithJSON.hs --- old/aeson-1.4.0.0/benchmarks/CompareWithJSON.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/benchmarks/CompareWithJSON.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,8 +1,9 @@ +{-# LANGUAGE NoImplicitPrelude #-} + {-# OPTIONS_GHC -fno-warn-orphans #-} module Main (main) where -import Prelude () import Prelude.Compat import Blaze.ByteString.Builder (toLazyByteString) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/Dates.hs new/aeson-1.4.1.0/benchmarks/Dates.hs --- old/aeson-1.4.0.0/benchmarks/Dates.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/benchmarks/Dates.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,6 +1,7 @@ +{-# LANGUAGE NoImplicitPrelude #-} + module Main (main) where -import Prelude () import Prelude.Compat import Criterion.Main diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/Escape.hs new/aeson-1.4.1.0/benchmarks/Escape.hs --- old/aeson-1.4.0.0/benchmarks/Escape.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/benchmarks/Escape.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,9 +1,10 @@ +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} + {-# OPTIONS_GHC -fno-warn-name-shadowing #-} module Main (main) where -import Prelude () import Prelude.Compat import Criterion.Main diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/JsonParse.hs new/aeson-1.4.1.0/benchmarks/JsonParse.hs --- old/aeson-1.4.0.0/benchmarks/JsonParse.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/benchmarks/JsonParse.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,10 +1,11 @@ {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} + {-# OPTIONS_GHC -fno-warn-orphans #-} module Main (main) where -import Prelude () import Prelude.Compat import Control.DeepSeq diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/Micro.hs new/aeson-1.4.1.0/benchmarks/Micro.hs --- old/aeson-1.4.0.0/benchmarks/Micro.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/benchmarks/Micro.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,6 +1,7 @@ +{-# LANGUAGE NoImplicitPrelude #-} + module Main (main) where -import Prelude () import Prelude.Compat import Criterion.Main diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/ReadFile.hs new/aeson-1.4.1.0/benchmarks/ReadFile.hs --- old/aeson-1.4.0.0/benchmarks/ReadFile.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/benchmarks/ReadFile.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,9 +1,9 @@ {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Main (main) where -import Prelude () import Prelude.Compat import Control.DeepSeq diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/Typed/Common.hs new/aeson-1.4.1.0/benchmarks/Typed/Common.hs --- old/aeson-1.4.0.0/benchmarks/Typed/Common.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/benchmarks/Typed/Common.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,8 +1,9 @@ +{-# LANGUAGE NoImplicitPrelude #-} + {-# OPTIONS_GHC -fno-warn-unused-imports #-} module Typed.Common (load) where -import Prelude () import Prelude.Compat import Data.ByteString.Lazy as L diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/Typed/Generic.hs new/aeson-1.4.1.0/benchmarks/Typed/Generic.hs --- old/aeson-1.4.0.0/benchmarks/Typed/Generic.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/benchmarks/Typed/Generic.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,6 +1,7 @@ +{-# LANGUAGE NoImplicitPrelude #-} + module Typed.Generic (benchmarks, decodeBenchmarks) where -import Prelude () import Prelude.Compat import Data.Aeson hiding (Result) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/Typed/Manual.hs new/aeson-1.4.1.0/benchmarks/Typed/Manual.hs --- old/aeson-1.4.0.0/benchmarks/Typed/Manual.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/benchmarks/Typed/Manual.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,6 +1,7 @@ +{-# LANGUAGE NoImplicitPrelude #-} + module Typed.Manual (benchmarks, decodeBenchmarks) where -import Prelude () import Prelude.Compat import Data.Aeson hiding (Result) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/Typed/TH.hs new/aeson-1.4.1.0/benchmarks/Typed/TH.hs --- old/aeson-1.4.0.0/benchmarks/Typed/TH.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/benchmarks/Typed/TH.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,6 +1,7 @@ +{-# LANGUAGE NoImplicitPrelude #-} + module Typed.TH (benchmarks, decodeBenchmarks) where -import Prelude () import Prelude.Compat import Data.Aeson hiding (Result) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/Typed.hs new/aeson-1.4.1.0/benchmarks/Typed.hs --- old/aeson-1.4.0.0/benchmarks/Typed.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/benchmarks/Typed.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,6 +1,7 @@ +{-# LANGUAGE NoImplicitPrelude #-} + module Main (main) where -import Prelude () import Prelude.Compat import Criterion.Main diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/benchmarks/aeson-benchmarks.cabal new/aeson-1.4.1.0/benchmarks/aeson-benchmarks.cabal --- old/aeson-1.4.0.0/benchmarks/aeson-benchmarks.cabal 2018-04-27 17:19:32.000000000 +0200 +++ new/aeson-1.4.1.0/benchmarks/aeson-benchmarks.cabal 2018-09-24 03:51:45.000000000 +0200 @@ -39,6 +39,7 @@ ghc-prim >= 0.2, hashable >= 1.1.2.0, mtl, + primitive >= 0.6.1, scientific >= 0.3.4.7 && < 0.4, syb, tagged >=0.8.3 && <0.9, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/changelog.md new/aeson-1.4.1.0/changelog.md --- old/aeson-1.4.0.0/changelog.md 2018-06-10 13:18:51.000000000 +0200 +++ new/aeson-1.4.1.0/changelog.md 2018-09-24 03:51:45.000000000 +0200 @@ -1,5 +1,15 @@ For the latest version of this document, please see [https://github.com/bos/aeson/blob/master/changelog.md](https://github.com/bos/aeson/blob/master/changelog.md). +#### 1.4.1.0 + +* Optimizations of generics, thanks to Rémy Oudompheng, here are some numbers for GHC 8.4: + * Compilation time: G/BigProduct.hs is 25% faster, G/BigRecord.hs is 2x faster. + * Runtime performance: BigRecord/toJSON/generic and BigProduct/encode/generic are more than 2x faster. +* Added To/FromJSON instances for `Void` and Generics's `V1`, thanks to Will Yager +* Added To/FromJSON instances for `primitive`'s `Array`, `SmallArray`, `PrimArray` and `UnliftedArray`, thanks to Andrew Thad. +* Fixes handling of `UTCTime` wrt. leap seconds , thanks to Adam Schønemann +* Warning and documentation fixes thanks to tom-bop, Gabor Greif, Ian Jeffries, and Mateusz Curyło. + ### 1.4.0.0 This release introduces bounds on the size of `Scientific` numbers when they are converted to other arbitrary precision types that do not represent them efficiently in memory. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/examples/Generic.hs new/aeson-1.4.1.0/examples/Generic.hs --- old/aeson-1.4.0.0/examples/Generic.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/examples/Generic.hs 2018-09-24 03:51:45.000000000 +0200 @@ -6,11 +6,11 @@ -- automatically derive the Generic class for us. {-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Main (main) where -import Prelude () import Prelude.Compat import Data.Aeson (FromJSON, ToJSON, decode, encode) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/examples/Simplest.hs new/aeson-1.4.1.0/examples/Simplest.hs --- old/aeson-1.4.0.0/examples/Simplest.hs 2017-11-20 15:58:29.000000000 +0100 +++ new/aeson-1.4.1.0/examples/Simplest.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,9 +1,9 @@ +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Main (main) where -import Prelude () import Prelude.Compat import Control.Applicative (empty) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/examples/TemplateHaskell.hs new/aeson-1.4.1.0/examples/TemplateHaskell.hs --- old/aeson-1.4.0.0/examples/TemplateHaskell.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/examples/TemplateHaskell.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,12 +1,12 @@ -- We can use Template Haskell (TH) to generate instances of the -- FromJSON and ToJSON classes automatically. This is the fastest way -- to add JSON support for a type. +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Main (main) where -import Prelude () import Prelude.Compat import Data.Aeson (decode, encode) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/examples/Twitter/Generic.hs new/aeson-1.4.1.0/examples/Twitter/Generic.hs --- old/aeson-1.4.0.0/examples/Twitter/Generic.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/examples/Twitter/Generic.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,5 +1,7 @@ -- Use GHC generics to automatically generate good instances. +{-# LANGUAGE NoImplicitPrelude #-} + {-# OPTIONS_GHC -fno-warn-orphans #-} module Twitter.Generic @@ -10,7 +12,6 @@ , Result(..) ) where -import Prelude () import Prelude.Compat () import Twitter diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/examples/Twitter/Manual.hs new/aeson-1.4.1.0/examples/Twitter/Manual.hs --- old/aeson-1.4.0.0/examples/Twitter/Manual.hs 2018-06-08 12:41:29.000000000 +0200 +++ new/aeson-1.4.1.0/examples/Twitter/Manual.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,7 +1,8 @@ -- Manually write instances. - +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} + {-# OPTIONS_GHC -fno-warn-orphans #-} module Twitter.Manual @@ -12,7 +13,6 @@ , Result(..) ) where -import Prelude () import Prelude.Compat import Control.Applicative diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/examples/Twitter/TH.hs new/aeson-1.4.1.0/examples/Twitter/TH.hs --- old/aeson-1.4.0.0/examples/Twitter/TH.hs 2017-12-06 00:04:11.000000000 +0100 +++ new/aeson-1.4.1.0/examples/Twitter/TH.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,6 +1,8 @@ -- Use Template Haskell to generate good instances. +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TemplateHaskell #-} + {-# OPTIONS_GHC -fno-warn-orphans #-} module Twitter.TH @@ -11,7 +13,6 @@ , Result(..) ) where -import Prelude () import Twitter import Twitter.Options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/examples/Twitter.hs new/aeson-1.4.1.0/examples/Twitter.hs --- old/aeson-1.4.0.0/examples/Twitter.hs 2018-01-08 15:55:11.000000000 +0100 +++ new/aeson-1.4.1.0/examples/Twitter.hs 2018-09-24 03:51:45.000000000 +0200 @@ -10,6 +10,7 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE NoImplicitPrelude #-} module Twitter ( @@ -19,7 +20,6 @@ , Result(..) ) where -import Prelude () import Prelude.Compat import Control.DeepSeq diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/stack-lts6.yaml new/aeson-1.4.1.0/stack-lts6.yaml --- old/aeson-1.4.0.0/stack-lts6.yaml 2018-04-27 17:19:32.000000000 +0200 +++ new/aeson-1.4.1.0/stack-lts6.yaml 2018-09-24 03:51:45.000000000 +0200 @@ -3,7 +3,6 @@ - '.' - attoparsec-iso8601 extra-deps: -- integer-logarithms-1 - semigroups-0.18.2 - tagged-0.8.5 - transformers-compat-0.5.1.4 @@ -13,6 +12,7 @@ - integer-logarithms-1 - quickcheck-instances-0.3.16 - th-abstraction-0.2.2.0 +- text-1.2.3.0 flags: flags: aeson: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/stack-lts7.yaml new/aeson-1.4.1.0/stack-lts7.yaml --- old/aeson-1.4.0.0/stack-lts7.yaml 2018-04-27 17:19:32.000000000 +0200 +++ new/aeson-1.4.1.0/stack-lts7.yaml 2018-09-24 03:51:45.000000000 +0200 @@ -9,6 +9,7 @@ - integer-logarithms-1 - quickcheck-instances-0.3.16 - th-abstraction-0.2.2.0 +- text-1.2.3.0 flags: aeson: fast: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/DataFamilies/Encoders.hs new/aeson-1.4.1.0/tests/DataFamilies/Encoders.hs --- old/aeson-1.4.0.0/tests/DataFamilies/Encoders.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/tests/DataFamilies/Encoders.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,10 +1,10 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TemplateHaskell #-} module DataFamilies.Encoders (module DataFamilies.Encoders) where -import Prelude () import Prelude.Compat import Data.Aeson.TH diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/DataFamilies/Instances.hs new/aeson-1.4.1.0/tests/DataFamilies/Instances.hs --- old/aeson-1.4.0.0/tests/DataFamilies/Instances.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/tests/DataFamilies/Instances.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,12 +1,13 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} + {-# OPTIONS_GHC -fno-warn-orphans #-} module DataFamilies.Instances () where -import Prelude () import Prelude.Compat import Data.Aeson.TH diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/DataFamilies/Properties.hs new/aeson-1.4.1.0/tests/DataFamilies/Properties.hs --- old/aeson-1.4.0.0/tests/DataFamilies/Properties.hs 2018-04-27 17:19:32.000000000 +0200 +++ new/aeson-1.4.1.0/tests/DataFamilies/Properties.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,8 +1,8 @@ {-# LANGUAGE CPP #-} +{-# LANGUAGE NoImplicitPrelude #-} module DataFamilies.Properties (tests) where -import Prelude () import Prelude.Compat import DataFamilies.Encoders diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/DataFamilies/Types.hs new/aeson-1.4.1.0/tests/DataFamilies/Types.hs --- old/aeson-1.4.0.0/tests/DataFamilies/Types.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/tests/DataFamilies/Types.hs 2018-09-24 03:51:45.000000000 +0200 @@ -4,13 +4,13 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module DataFamilies.Types (module DataFamilies.Types) where -import Prelude () import Prelude.Compat import Generics.Deriving.TH (deriveAll0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/Encoders.hs new/aeson-1.4.1.0/tests/Encoders.hs --- old/aeson-1.4.0.0/tests/Encoders.hs 2017-10-26 16:26:50.000000000 +0200 +++ new/aeson-1.4.1.0/tests/Encoders.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,10 +1,10 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TemplateHaskell #-} module Encoders (module Encoders) where -import Prelude () import Prelude.Compat import Data.Aeson.TH diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/ErrorMessages.hs new/aeson-1.4.1.0/tests/ErrorMessages.hs --- old/aeson-1.4.0.0/tests/ErrorMessages.hs 2018-06-08 12:41:29.000000000 +0200 +++ new/aeson-1.4.1.0/tests/ErrorMessages.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,3 +1,4 @@ +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -6,7 +7,6 @@ tests ) where -import Prelude () import Prelude.Compat import Data.Aeson (FromJSON(..), eitherDecode) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/Functions.hs new/aeson-1.4.1.0/tests/Functions.hs --- old/aeson-1.4.0.0/tests/Functions.hs 2017-10-26 16:26:29.000000000 +0200 +++ new/aeson-1.4.1.0/tests/Functions.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,10 +1,11 @@ +{-# LANGUAGE NoImplicitPrelude #-} + module Functions ( approxEq , approxEqWith ) where -import Prelude () import Prelude.Compat approxEq :: (Fractional a, Ord a) => a -> a -> Bool diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/Instances.hs new/aeson-1.4.1.0/tests/Instances.hs --- old/aeson-1.4.0.0/tests/Instances.hs 2017-10-26 16:26:50.000000000 +0200 +++ new/aeson-1.4.1.0/tests/Instances.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,13 +1,14 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} + {-# OPTIONS_GHC -fno-warn-orphans #-} module Instances () where -import Prelude () import Prelude.Compat import Control.Applicative (empty) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/Options.hs new/aeson-1.4.1.0/tests/Options.hs --- old/aeson-1.4.0.0/tests/Options.hs 2017-10-26 16:26:50.000000000 +0200 +++ new/aeson-1.4.1.0/tests/Options.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,6 +1,7 @@ +{-# LANGUAGE NoImplicitPrelude #-} + module Options (module Options) where -import Prelude () import Prelude.Compat import Data.Aeson.Types diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/Properties.hs new/aeson-1.4.1.0/tests/Properties.hs --- old/aeson-1.4.0.0/tests/Properties.hs 2018-04-27 17:19:32.000000000 +0200 +++ new/aeson-1.4.1.0/tests/Properties.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,12 +1,12 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} -- For arbitrary Compose +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} module Properties (module Properties) where -import Prelude () import Prelude.Compat import Control.Applicative (Const) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/SerializationFormatSpec.hs new/aeson-1.4.1.0/tests/SerializationFormatSpec.hs --- old/aeson-1.4.0.0/tests/SerializationFormatSpec.hs 2018-06-08 12:41:29.000000000 +0200 +++ new/aeson-1.4.1.0/tests/SerializationFormatSpec.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,6 +1,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} #if __GLASGOW_HASKELL__ >= 708 {-# LANGUAGE DataKinds #-} @@ -15,7 +16,6 @@ tests ) where -import Prelude () import Prelude.Compat import Control.Applicative (Const(..)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/Tests.hs new/aeson-1.4.1.0/tests/Tests.hs --- old/aeson-1.4.0.0/tests/Tests.hs 2018-06-08 17:45:59.000000000 +0200 +++ new/aeson-1.4.1.0/tests/Tests.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,6 +1,7 @@ +{-# LANGUAGE NoImplicitPrelude #-} + module Main (main) where -import Prelude () import Prelude.Compat import Test.Tasty (defaultMain, testGroup) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/Types.hs new/aeson-1.4.1.0/tests/Types.hs --- old/aeson-1.4.0.0/tests/Types.hs 2017-10-26 16:26:50.000000000 +0200 +++ new/aeson-1.4.1.0/tests/Types.hs 2018-09-24 03:51:45.000000000 +0200 @@ -4,15 +4,16 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE StandaloneDeriving #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE StandaloneDeriving #-} module Types (module Types) where -import Prelude () import Prelude.Compat import Math.NumberTheory.Logarithms (intLog2) +import Control.Applicative ((<$>)) import Data.Data import Data.Functor.Compose (Compose (..)) import Data.Functor.Identity (Identity (..)) @@ -152,7 +153,7 @@ hashWithSalt salt (LogScaled a) = hashWithSalt salt a instance Arbitrary a => Arbitrary (LogScaled a) where - arbitrary = fmap LogScaled $ scale (\x -> intLog2 $ x + 1) arbitrary + arbitrary = LogScaled <$> scale (\x -> intLog2 $ x + 1) arbitrary shrink = fmap LogScaled . shrink . getLogScaled instance ToJSON a => ToJSON (LogScaled a) where diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/UnitTests/NullaryConstructors.hs new/aeson-1.4.1.0/tests/UnitTests/NullaryConstructors.hs --- old/aeson-1.4.0.0/tests/UnitTests/NullaryConstructors.hs 2018-06-08 12:41:29.000000000 +0200 +++ new/aeson-1.4.1.0/tests/UnitTests/NullaryConstructors.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,4 +1,5 @@ -{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-deprecations #-} @@ -7,7 +8,6 @@ nullaryConstructors ) where -import Prelude () import Prelude.Compat import Data.Aeson (decode, eitherDecode, fromEncoding, Value) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aeson-1.4.0.0/tests/UnitTests.hs new/aeson-1.4.1.0/tests/UnitTests.hs --- old/aeson-1.4.0.0/tests/UnitTests.hs 2018-06-09 11:39:16.000000000 +0200 +++ new/aeson-1.4.1.0/tests/UnitTests.hs 2018-09-24 03:51:45.000000000 +0200 @@ -1,6 +1,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} @@ -19,7 +20,6 @@ , withEmbeddedJSONTest ) where -import Prelude () import Prelude.Compat import Control.Monad (forM, forM_) @@ -199,6 +199,14 @@ assertEqual "utctime" (parseWithRead "%F %H:%MZ" ts11) t11 assertEqual "utctime" (parseWithRead "%FT%T%QZ" "2015-01-01T14:30:00Z") t12 + -- leap seconds are included correctly + let ts13 = "2015-08-23T23:59:60.128+00" :: LT.Text + let (Just (t13 :: UTCTime)) = parseWithAeson ts13 + assertEqual "utctime" (parseWithRead "%FT%T%QZ" "2015-08-23T23:59:60.128Z") t13 + let ts14 = "2015-08-23T23:59:60.999999999999+00" :: LT.Text + let (Just (t14 :: UTCTime)) = parseWithAeson ts14 + assertEqual "utctime" (parseWithRead "%FT%T%QZ" "2015-08-23T23:59:60.999999999999Z") t14 + where parseWithRead :: String -> LT.Text -> UTCTime parseWithRead f s = @@ -218,6 +226,7 @@ verifyFailParse "2015-01-01T12:30:00.00+00:00Z" -- no Zulu if offset given verifyFailParse "2015-01-03 12:13:00.Z" -- decimal at the end but no digits verifyFailParse "2015-01-03 12:13.000Z" -- decimal at the end, but no seconds + verifyFailParse "2015-01-03 23:59:61Z" -- exceeds allowed seconds per day where verifyFailParse (s :: LT.Text) = let (dec :: Maybe UTCTime) = decode . LT.encodeUtf8 $ LT.concat ["\"", s, "\""] in ++++++ aeson.cabal ++++++ name: aeson version: 1.4.1.0 x-revision: 1 license: BSD3 license-file: LICENSE category: Text, Web, JSON copyright: (c) 2011-2016 Bryan O'Sullivan (c) 2011 MailRank, Inc. author: Bryan O'Sullivan <[email protected]> maintainer: Adam Bergmark <[email protected]> stability: experimental tested-with: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1 synopsis: Fast JSON parsing and encoding cabal-version: >= 1.10 homepage: https://github.com/bos/aeson bug-reports: https://github.com/bos/aeson/issues build-type: Simple description: A JSON parsing and encoding library optimized for ease of use and high performance. . To get started, see the documentation for the @Data.Aeson@ module below. . (A note on naming: in Greek mythology, Aeson was the father of Jason.) extra-source-files: *.yaml README.markdown benchmarks/*.cabal benchmarks/*.hs benchmarks/*.py benchmarks/Compare/*.hs benchmarks/Makefile benchmarks/Typed/*.hs benchmarks/json-data/*.json cbits/*.c changelog.md examples/*.cabal examples/*.hs examples/Twitter/*.hs ffi/Data/Aeson/Parser/*.hs include/*.h tests/JSONTestSuite/test_parsing/*.json tests/JSONTestSuite/test_transform/*.json pure/Data/Aeson/Parser/*.hs flag developer description: operate in developer mode default: False manual: True flag fast description: compile without optimizations default: False manual: True flag bytestring-builder description: Depend on the bytestring-builder package for backwards compatibility. default: False manual: False flag cffi description: Controls whether to include c-ffi bits or pure haskell. Default to False for security. default: False manual: True library default-language: Haskell2010 hs-source-dirs: . attoparsec-iso8601/ exposed-modules: Data.Aeson Data.Aeson.Encoding Data.Aeson.Parser Data.Aeson.Text Data.Aeson.Types Data.Aeson.TH Data.Aeson.Encoding.Internal Data.Aeson.Internal Data.Aeson.Internal.Time Data.Aeson.Parser.Internal -- Deprecated modules exposed-modules: Data.Aeson.Encode other-modules: Data.Aeson.Compat Data.Aeson.Encoding.Builder Data.Aeson.Internal.Functions Data.Aeson.Parser.Unescape Data.Aeson.Parser.Time Data.Aeson.Types.FromJSON Data.Aeson.Types.Generic Data.Aeson.Types.ToJSON Data.Aeson.Types.Class Data.Aeson.Types.Internal Data.Attoparsec.Time Data.Attoparsec.Time.Internal build-depends: attoparsec >= 0.13.0.1, base >= 4.5 && < 5, base-compat >= 0.9.1 && < 0.11, containers >= 0.4.2, deepseq >= 1.3 && < 1.5, dlist >= 0.6, ghc-prim >= 0.2, hashable >= 1.1.2.0, primitive >= 0.6.2.0 && < 0.7, scientific >= 0.3.4.7 && < 0.4, tagged >=0.8.3 && <0.9, template-haskell >= 2.7, text >= 1.2.3, th-abstraction >= 0.2.2 && < 0.3, time >= 1.1.1.4, time-locale-compat >= 0.1.1 && < 0.2, unordered-containers >= 0.2.5.0 && < 0.3, uuid-types >= 1.0.3 && <1.1, vector >= 0.8 if flag(bytestring-builder) build-depends: bytestring >= 0.9.2 && < 0.10.4, bytestring-builder >= 0.10.4 && < 1 else build-depends: bytestring >= 0.10.4 && < 0.11 if !impl(ghc >= 8.0) -- `Data.Semigroup` and `Control.Monad.Fail` and `Control.Monad.IO.Class` are available in base only since GHC 8.0 / base 4.9 build-depends: semigroups >= 0.18.2 && < 0.19, transformers >= 0.2.2.0, transformers-compat >= 0.3, fail == 4.9.* if !impl(ghc >= 7.10) -- `Numeric.Natural` is available in base only since GHC 7.10 / base 4.8 build-depends: nats >= 1 && < 1.2, void >= 0.7.2 && < 0.8 ghc-options: -Wall if flag(developer) ghc-options: -Werror ghc-prof-options: -auto-all if flag(fast) ghc-options: -O0 else ghc-options: -O2 include-dirs: include if impl(ghcjs) || !flag(cffi) hs-source-dirs: pure other-modules: Data.Aeson.Parser.UnescapePure else c-sources: cbits/unescape_string.c cpp-options: -DCFFI hs-source-dirs: ffi other-modules: Data.Aeson.Parser.UnescapeFFI test-suite tests default-language: Haskell2010 type: exitcode-stdio-1.0 hs-source-dirs: tests ffi pure main-is: Tests.hs c-sources: cbits/unescape_string.c ghc-options: -Wall -threaded -rtsopts other-modules: Data.Aeson.Parser.UnescapeFFI Data.Aeson.Parser.UnescapePure DataFamilies.Properties DataFamilies.Instances DataFamilies.Encoders DataFamilies.Types Encoders ErrorMessages Functions Instances Options Properties SerializationFormatSpec Types UnitTests UnitTests.NullaryConstructors build-depends: QuickCheck >= 2.10.0.1 && < 2.12, aeson, integer-logarithms >= 1 && <1.1, attoparsec, base, base-compat, base-orphans >= 0.5.3 && <0.8, base16-bytestring, containers, directory, dlist, filepath, generic-deriving >= 1.10 && < 1.13, ghc-prim >= 0.2, hashable >= 1.2.4.0, scientific, tagged, template-haskell, tasty, tasty-hunit, tasty-quickcheck, text, time, time-locale-compat, unordered-containers, uuid-types, vector, quickcheck-instances >= 0.3.16 if flag(bytestring-builder) build-depends: bytestring >= 0.9 && < 0.10.4, bytestring-builder >= 0.10.4 && < 1 else build-depends: bytestring >= 0.10.4 if !impl(ghc >= 8.0) build-depends: semigroups >= 0.18.2 && < 0.19, transformers >= 0.2.2.0, transformers-compat >= 0.3 if !impl(ghc >= 7.10) build-depends: nats >=1 && <1.2, void >=0.7.2 && <0.8 if impl(ghc >= 7.8) build-depends: hashable-time >= 0.2 && <0.3 if flag(fast) ghc-options: -fno-enable-rewrite-rules source-repository head type: git location: git://github.com/bos/aeson.git
