From 715b3c16d3f1610c41a4e9f9f4bcaa8ab6f98627 Mon Sep 17 00:00:00 2001 From: Li-yao Xia Date: Sun, 5 Jul 2026 11:23:07 +0200 Subject: [PATCH 1/7] Add doc on Complex instances --- src/Data/Aeson/Types/FromJSON.hs | 1 + src/Data/Aeson/Types/ToJSON.hs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Data/Aeson/Types/FromJSON.hs b/src/Data/Aeson/Types/FromJSON.hs index 2639fa0a..ca10ab1a 100644 --- a/src/Data/Aeson/Types/FromJSON.hs +++ b/src/Data/Aeson/Types/FromJSON.hs @@ -1725,6 +1725,7 @@ instance (FromJSON a, Integral a) => FromJSON (Ratio a) where then fail "Ratio denominator was 0" else pure $ numerator % denominator +-- | A complex number @x+iy@ is encoded as an array @[x, y]@. instance FromJSON a => FromJSON (Complex a) where parseJSON = withArray "Complex" $ \c -> let n = V.length c diff --git a/src/Data/Aeson/Types/ToJSON.hs b/src/Data/Aeson/Types/ToJSON.hs index a1f76d18..01837c3d 100644 --- a/src/Data/Aeson/Types/ToJSON.hs +++ b/src/Data/Aeson/Types/ToJSON.hs @@ -1425,6 +1425,7 @@ instance (ToJSON a, Integral a) => ToJSON (Ratio a) where "numerator" .= numerator r <> "denominator" .= denominator r +-- | A complex number @x+iy@ is encoded as an array @[x, y]@. instance ToJSON a => ToJSON (Complex a) where toJSON (i :+ q) = Array $ V.create $ do mv <- VM.unsafeNew 2 From e1162b565ac5db22a0b21adbf1ad24aa3e2e9a57 Mon Sep 17 00:00:00 2001 From: Li-yao Xia Date: Sun, 5 Jul 2026 11:24:34 +0200 Subject: [PATCH 2/7] LICENSE: Update year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 6ef84748..86ca6227 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011, MailRank, Inc. 2014-2021 Aeson project contributors +Copyright (c) 2011, MailRank, Inc. 2014-2026 Aeson project contributors All rights reserved. From 0968ed652d9271b05d58d6338f85fd992971ddf0 Mon Sep 17 00:00:00 2001 From: Li-yao Xia Date: Sun, 5 Jul 2026 11:39:28 +0200 Subject: [PATCH 3/7] cabal: Update authorship information --- aeson.cabal | 12 +++++++----- attoparsec-aeson/attoparsec-aeson.cabal | 12 +++++++----- attoparsec-iso8601/attoparsec-iso8601.cabal | 12 +++++++----- text-iso8601/text-iso8601.cabal | 7 +++++-- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/aeson.cabal b/aeson.cabal index 87877928..adc23ddf 100644 --- a/aeson.cabal +++ b/aeson.cabal @@ -5,12 +5,14 @@ license: BSD-3-Clause license-file: LICENSE category: Text, Web, JSON copyright: - (c) 2011-2016 Bryan O'Sullivan - (c) 2011 MailRank, Inc. - + 2014-2026 Aeson project contributors, + 2011-2016 Bryan O'Sullivan, + 2011 MailRank, Inc. author: Bryan O'Sullivan -maintainer: Adam Bergmark -stability: experimental +maintainer: + Li-yao Xia , + Core Libraries Committee +stability: stable tested-with: GHC ==8.6.5 || ==8.8.4 diff --git a/attoparsec-aeson/attoparsec-aeson.cabal b/attoparsec-aeson/attoparsec-aeson.cabal index 67b51fba..b1961952 100644 --- a/attoparsec-aeson/attoparsec-aeson.cabal +++ b/attoparsec-aeson/attoparsec-aeson.cabal @@ -9,12 +9,14 @@ license: BSD-3-Clause license-file: LICENSE category: Parsing copyright: - (c) 2011-2016 Bryan O'Sullivan - (c) 2011 MailRank, Inc. - + 2014-2026 Aeson project contributors, + 2011-2016 Bryan O'Sullivan, + 2011 MailRank, Inc. author: Bryan O'Sullivan -maintainer: Oleg Grenrus -stability: experimental +maintainer: + Li-yao Xia , + Core Libraries Committee +stability: stable homepage: https://github.com/haskell/aeson bug-reports: https://github.com/haskell/aeson/issues build-type: Simple diff --git a/attoparsec-iso8601/attoparsec-iso8601.cabal b/attoparsec-iso8601/attoparsec-iso8601.cabal index 6ba4955d..7898e574 100644 --- a/attoparsec-iso8601/attoparsec-iso8601.cabal +++ b/attoparsec-iso8601/attoparsec-iso8601.cabal @@ -7,12 +7,14 @@ license: BSD3 license-file: LICENSE category: Parsing copyright: - (c) 2011-2016 Bryan O'Sullivan - (c) 2011 MailRank, Inc. - + 2014-2026 Aeson project contributors, + 2011-2016 Bryan O'Sullivan, + 2011 MailRank, Inc. author: Bryan O'Sullivan -maintainer: Adam Bergmark -stability: experimental +maintainer: + Li-yao Xia , + Core Libraries Committee +stability: stable cabal-version: 1.12 homepage: https://github.com/haskell/aeson bug-reports: https://github.com/haskell/aeson/issues diff --git a/text-iso8601/text-iso8601.cabal b/text-iso8601/text-iso8601.cabal index 3eac54be..a4e92f29 100644 --- a/text-iso8601/text-iso8601.cabal +++ b/text-iso8601/text-iso8601.cabal @@ -9,10 +9,13 @@ description: license: BSD3 license-file: LICENSE category: Parsing -copyright: Oleg Grenrus +copyright: + 2026 Aeson project contributors, + 2023-2026 Oleg Grenrus author: Oleg Grenrus maintainer: - Oleg Grenrus + Li-yao Xia , + Core Libraries Committee homepage: https://github.com/haskell/aeson bug-reports: https://github.com/haskell/aeson/issues From 985203e245aad86bebd759ac9f9125ab56880f7e Mon Sep 17 00:00:00 2001 From: Li-yao Xia Date: Sun, 5 Jul 2026 11:51:03 +0200 Subject: [PATCH 4/7] README: Remove mention of Mercurial --- README.markdown | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.markdown b/README.markdown index 5ebf7ea4..0d8add9b 100644 --- a/README.markdown +++ b/README.markdown @@ -20,9 +20,6 @@ See what's changed in recent (and upcoming) releases: * https://github.com/haskell/aeson/blob/master/changelog.md -(You can create and contribute changes using either git or Mercurial.) - - # Authors This library was originally written by Bryan O'Sullivan. From e342c724e6adc3caa2edf37320b16ec2bde9d947 Mon Sep 17 00:00:00 2001 From: Li-yao Xia Date: Sun, 5 Jul 2026 11:55:10 +0200 Subject: [PATCH 5/7] cabal: Move changelog and readme to extra-doc-files --- aeson.cabal | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aeson.cabal b/aeson.cabal index adc23ddf..c793d464 100644 --- a/aeson.cabal +++ b/aeson.cabal @@ -38,12 +38,12 @@ description: below. . (A note on naming: in Greek mythology, Aeson was the father of Jason.) - +extra-doc-files: + README.markdown + changelog.md extra-source-files: *.yaml benchmarks/json-data/*.json - changelog.md - README.markdown tests/golden/*.expected tests/JSONTestSuite/results/*.tok tests/JSONTestSuite/results/*.txt From 5255e4c22680e6a0b2ec33807436bf754678e586 Mon Sep 17 00:00:00 2001 From: Li-yao Xia Date: Sun, 5 Jul 2026 11:59:36 +0200 Subject: [PATCH 6/7] doc: Add since annotations for 2.3.1.0 --- src/Data/Aeson/Types/FromJSON.hs | 4 ++++ src/Data/Aeson/Types/Internal.hs | 2 ++ src/Data/Aeson/Types/ToJSON.hs | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/Data/Aeson/Types/FromJSON.hs b/src/Data/Aeson/Types/FromJSON.hs index ca10ab1a..8a8f2a96 100644 --- a/src/Data/Aeson/Types/FromJSON.hs +++ b/src/Data/Aeson/Types/FromJSON.hs @@ -1726,6 +1726,8 @@ instance (FromJSON a, Integral a) => FromJSON (Ratio a) where else pure $ numerator % denominator -- | A complex number @x+iy@ is encoded as an array @[x, y]@. +-- +-- @since 2.3.1.0 instance FromJSON a => FromJSON (Complex a) where parseJSON = withArray "Complex" $ \c -> let n = V.length c @@ -1741,6 +1743,8 @@ instance FromJSON a => FromJSON (Complex a) where instance HasResolution a => FromJSON (Fixed a) where parseJSON = prependContext "Fixed" . withBoundedScientific' (pure . realToFrac) +-- | +-- @since 2.3.1.0 instance HasResolution a => FromJSONKey (Fixed a) where fromJSONKey = FromJSONKeyTextParser $ \t -> realToFrac <$> parseBoundedScientificText "Fixed" t diff --git a/src/Data/Aeson/Types/Internal.hs b/src/Data/Aeson/Types/Internal.hs index c7402a18..a0f6ac10 100644 --- a/src/Data/Aeson/Types/Internal.hs +++ b/src/Data/Aeson/Types/Internal.hs @@ -556,6 +556,8 @@ emptyArray = Array V.empty -- -- Do note that if this is `False`, the `Value` may be a non-empty -- array, or it may not even be an array. +-- +-- @since 2.3.1.0 isEmptyArray :: Value -> Bool isEmptyArray (Array arr) = V.null arr isEmptyArray _ = False diff --git a/src/Data/Aeson/Types/ToJSON.hs b/src/Data/Aeson/Types/ToJSON.hs index 01837c3d..450f3f3b 100644 --- a/src/Data/Aeson/Types/ToJSON.hs +++ b/src/Data/Aeson/Types/ToJSON.hs @@ -1426,6 +1426,8 @@ instance (ToJSON a, Integral a) => ToJSON (Ratio a) where "denominator" .= denominator r -- | A complex number @x+iy@ is encoded as an array @[x, y]@. +-- +-- @since 2.3.1.0 instance ToJSON a => ToJSON (Complex a) where toJSON (i :+ q) = Array $ V.create $ do mv <- VM.unsafeNew 2 From bf94df65ec1005368e69a2ccee027e54b4e9c87a Mon Sep 17 00:00:00 2001 From: Li-yao Xia Date: Sun, 5 Jul 2026 11:23:42 +0200 Subject: [PATCH 7/7] Release 2.3.1.0 --- aeson.cabal | 2 +- changelog.md | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/aeson.cabal b/aeson.cabal index c793d464..105922fa 100644 --- a/aeson.cabal +++ b/aeson.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: aeson -version: 2.3.0.0 +version: 2.3.1.0 license: BSD-3-Clause license-file: LICENSE category: Text, Web, JSON diff --git a/changelog.md b/changelog.md index 44c5b665..5496a8c6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,8 +1,11 @@ For the latest version of this document, please see [https://github.com/haskell/aeson/blob/master/changelog.md](https://github.com/haskell/aeson/blob/master/changelog.md). -### Upcoming +### 2.3.1.0 -* Expose `isEmptyArray` from `Data.Aeson.Types` module. +* Add `FromJSONKey` instance for `Data.Fixed`. +* Add `ToJSON` and `FromJSON` instances for `Data.Complex`. +* Export `isEmptyArray` from `Data.Aeson.Types` module. +* Document that file decoding functions throw an exception when the file is missing. ### 2.3.0.0 - 2026-05-21