From c8831dd552457cf96e60b62e2bdd99a2cb2d4070 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Tue, 27 Jun 2023 12:14:42 +0300 Subject: [PATCH] Prepare 2.2 release. - Bump bounds - Update changelog --- aeson.cabal | 6 +++--- changelog.md | 15 +++++++++++---- text-iso8601/src/Data/Time/FromText.hs | 5 +++++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/aeson.cabal b/aeson.cabal index cb873a2cd..99c918e9b 100644 --- a/aeson.cabal +++ b/aeson.cabal @@ -1,5 +1,5 @@ name: aeson -version: 2.2 +version: 2.2.0.0 license: BSD3 license-file: LICENSE category: Text, Web, JSON @@ -112,7 +112,7 @@ library build-depends: data-fix >=0.3.2 && <0.4 , dlist >=1.0 && <1.1 - , hashable >=1.3.5.0 && <1.5 + , hashable >=1.4.2.0 && <1.5 , indexed-traversable >=0.1.2 && <0.2 , integer-conversion >=0.1 && <0.2 , network-uri >=2.6.4.1 && <2.7 @@ -129,7 +129,7 @@ library , these >=1.2 && <1.3 , unordered-containers >=0.2.10.0 && <0.3 , uuid-types >=1.0.5 && <1.1 - , vector >=0.12.0.1 && <0.14 + , vector >=0.13.0.0 && <0.14 , witherable >=0.4.2 && <0.5 ghc-options: -Wall diff --git a/changelog.md b/changelog.md index 6b8c5987d..88fd97ab7 100644 --- a/changelog.md +++ b/changelog.md @@ -20,10 +20,11 @@ For the latest version of this document, please see [https://github.com/haskell/ Additionall "boring" types like `()` and `Proxy` are omitted as well. As the omitting is now uniform, type arguments are also omitted (also in `Generic1` derived instance). - Resolves issues - [#687](https://github.com/haskell/aeson/issues/687), - [#571](https://github.com/haskell/aeson/issues/571), - [#792](https://github.com/haskell/aeson/issues/792). + Resolves issues: + + - [#687](https://github.com/haskell/aeson/issues/687) Derived ToJSON1 instance does not respect omitNothingFields = True, + - [#571](https://github.com/haskell/aeson/issues/571) omitNothingFields not used in Generic Decode, + - [#792](https://github.com/haskell/aeson/issues/792) Make Proxy fields optional. * Use `Data.Aeson.Decoding` parsing functions (introduced in version 2.1.2.0) as default in `Data.Aeson`. As one side-effect, `decode` and `decode'` etc pair functions are operationally the same. @@ -33,12 +34,18 @@ For the latest version of this document, please see [https://github.com/haskell/ * Move `Data.Aeson.Parser` module into separate [`attoparsec-aeson`](https://hackage.haskell.org/package/attoparsec-aeson) package, as these parsers are not used by `aeson` itself anymore. * Use [`text-iso8601`](https://hackage.haskell.org/package/text-iso8601) package for parsing `time` types. These are slightly faster than previously used (copy of) `attoparsec-iso8601`. + Formats accepted is slightly changed: + - The space between time and timezone offset (in `UTCTime` and `ZonedTime`) is disallowed. ISO8601 explictly forbidds it. + - The timezone offsets can be in range -23:59..23:59. This is how Python, joda-time etc seems to do. (Previously the range was -12..+14) + * Remove `cffi` flag. Toggling the flag made `aeson` use a C implementation for string unescaping (used for `text <2` versions). The new native Haskell implementation (introduced in version 2.0.3.0) is at least as fast. * Drop instances for `Number` from `attoparsec` package. * Improve `Arbitrary Value` instance. * Add instances for `URI` from `network-uri`. * add instances for `Down` from `Data.Ord`. +* Use `integer-conversion` for converting `Text` and `ByteString`s into `Integer`s. +* Bump lower bounds of non GHC-boot lib dependencies. ### 2.1.2.1 diff --git a/text-iso8601/src/Data/Time/FromText.hs b/text-iso8601/src/Data/Time/FromText.hs index 2c8271b77..c51897d9e 100644 --- a/text-iso8601/src/Data/Time/FromText.hs +++ b/text-iso8601/src/Data/Time/FromText.hs @@ -488,6 +488,11 @@ parseTimeZone__ x kont c t0 = case c of withResult :: (Int -> Int) -> Int -> Int -> (Local.TimeZone -> Either String b) -> Either String b withResult posNeg hh mm kontR = + -- we accept hours <24 and minutes <60 + -- this is how grammar implies, and also how python, joda-time + -- and clojure #inst literals seem to work. + -- Java's java.time seems to restrict to -18..18: https://docs.oracle.com/javase/8/docs/api/java/time/ZoneOffset.html + -- but that seems more arbitrary. if hh < 24 && mm < 60 then kontR (Local.minutesToTimeZone (posNeg (hh * 60 + mm))) else Left $ "Invalid TimeZone:" ++ show (hh, mm)