Skip to content

Commit

Permalink
Prepare 2.2 release.
Browse files Browse the repository at this point in the history
- Bump bounds
- Update changelog
  • Loading branch information
phadej committed Jun 27, 2023
1 parent f8b5413 commit c8831dd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
6 changes: 3 additions & 3 deletions aeson.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: aeson
version: 2.2
version: 2.2.0.0
license: BSD3
license-file: LICENSE
category: Text, Web, JSON
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
15 changes: 11 additions & 4 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down
5 changes: 5 additions & 0 deletions text-iso8601/src/Data/Time/FromText.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c8831dd

Please sign in to comment.