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. 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. diff --git a/aeson.cabal b/aeson.cabal index 87877928..105922fa 100644 --- a/aeson.cabal +++ b/aeson.cabal @@ -1,16 +1,18 @@ 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 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 @@ -36,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 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/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 diff --git a/src/Data/Aeson/Types/FromJSON.hs b/src/Data/Aeson/Types/FromJSON.hs index 2639fa0a..8a8f2a96 100644 --- a/src/Data/Aeson/Types/FromJSON.hs +++ b/src/Data/Aeson/Types/FromJSON.hs @@ -1725,6 +1725,9 @@ 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]@. +-- +-- @since 2.3.1.0 instance FromJSON a => FromJSON (Complex a) where parseJSON = withArray "Complex" $ \c -> let n = V.length c @@ -1740,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 a1f76d18..450f3f3b 100644 --- a/src/Data/Aeson/Types/ToJSON.hs +++ b/src/Data/Aeson/Types/ToJSON.hs @@ -1425,6 +1425,9 @@ 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]@. +-- +-- @since 2.3.1.0 instance ToJSON a => ToJSON (Complex a) where toJSON (i :+ q) = Array $ V.create $ do mv <- VM.unsafeNew 2 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