Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
3 changes: 0 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
20 changes: 11 additions & 9 deletions aeson.cabal
Original file line number Diff line number Diff line change
@@ -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 <bos@serpentine.com>
maintainer: Adam Bergmark <adam@bergmark.nl>
stability: experimental
maintainer:
Li-yao Xia <lysxia@gmail.com>,
Core Libraries Committee
stability: stable
tested-with:
GHC ==8.6.5
|| ==8.8.4
Expand All @@ -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
Expand Down
12 changes: 7 additions & 5 deletions attoparsec-aeson/attoparsec-aeson.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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 <bos@serpentine.com>
maintainer: Oleg Grenrus <oleg.grenrus@iki.fi>
stability: experimental
maintainer:
Li-yao Xia <lysxia@gmail.com>,
Core Libraries Committee
stability: stable
homepage: https://github.com/haskell/aeson
bug-reports: https://github.com/haskell/aeson/issues
build-type: Simple
Expand Down
12 changes: 7 additions & 5 deletions attoparsec-iso8601/attoparsec-iso8601.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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 <bos@serpentine.com>
maintainer: Adam Bergmark <adam@bergmark.nl>
stability: experimental
maintainer:
Li-yao Xia <lysxia@gmail.com>,
Core Libraries Committee
stability: stable
cabal-version: 1.12
homepage: https://github.com/haskell/aeson
bug-reports: https://github.com/haskell/aeson/issues
Expand Down
7 changes: 5 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 5 additions & 0 deletions src/Data/Aeson/Types/FromJSON.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/Data/Aeson/Types/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/Data/Aeson/Types/ToJSON.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions text-iso8601/text-iso8601.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ description:
license: BSD3
license-file: LICENSE
category: Parsing
copyright: Oleg Grenrus <oleg.grenrus@iki.fi>
copyright:
2026 Aeson project contributors,
2023-2026 Oleg Grenrus
author: Oleg Grenrus <oleg.grenrus@iki.fi>
maintainer:
Oleg Grenrus <oleg.grenrus@iki.fi>
Li-yao Xia <lysxia@gmail.com>,
Core Libraries Committee

homepage: https://github.com/haskell/aeson
bug-reports: https://github.com/haskell/aeson/issues
Expand Down