Skip to content

Commit 704a403

Browse files
committed
Add changelog about decodeStrictText
1 parent b438e32 commit 704a403

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

changelog.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ For the latest version of this document, please see [https://github.com/haskell/
44

55
* Add `Data.Aeson.RFC8785`, a JSON Canonicalization Scheme implementation
66
https://datatracker.ietf.org/doc/html/rfc8785
7+
* Add Data.Aeson.Decoding.Text, decodeStrictText :: Text -> ...
8+
9+
We avoid intermediate `ByteString` copy by not doing
10+
`decode . TE.encodeUtf8`, but instead working on `Text` value directly.
11+
As we know that the stream is valid Unicode (UTF8 or UTF16),
12+
we can also take some shortcuts.
13+
14+
One gotcha is that internal `Text` values (in `Key`s or `Value` `String`s)
15+
will most likely retain the original input `Text` value (its underlying `Array`).
16+
It shouldn't be an issue if the `Value` is then decoded to something else so these
17+
`Text` values disapper, but if not (e.g. `Object` keys survive)
18+
then users might want to use `Data.Text.copy`.
719

820
### 2.2.0.0
921

0 commit comments

Comments
 (0)