Skip to content
Open
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 benchmarks/bench/UnescapePureText1.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--
-- WARNING: This file is security sensitive as it uses unsafeWrite which does
-- not check bounds. Any changes should be made with care and we would love to
-- get informed about them, just cc us in any PR targetting this file: @eskimor @jprider63
-- get informed about them, just cc us in any PR targeting this file: @eskimor @jprider63
-- We would be happy to review the changes!

-- The security check at the end (pos > length) only works if pos grows
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench/UnescapePureText2.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--
-- WARNING: This file is security sensitive as it uses unsafeWrite which does
-- not check bounds. Any changes should be made with care and we would love to
-- get informed about them, just cc us in any PR targetting this file: @eskimor @jprider63
-- get informed about them, just cc us in any PR targeting this file: @eskimor @jprider63
-- We would be happy to review the changes!

-- The security check at the end (pos > length) only works if pos grows
Expand Down
8 changes: 4 additions & 4 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ For the latest version of this document, please see [https://github.com/haskell/
One gotcha is that internal `Text` values (in `Key`s or `Value` `String`s)
will most likely retain the original input `Text` value (its underlying `Array`).
It shouldn't be an issue if the `Value` is then decoded to something else so these
`Text` values disapper, but if not (e.g. `Object` keys survive)
`Text` values disappear, but if not (e.g. `Object` keys survive)
then users might want to use `Data.Text.copy`.

### 2.2.0.0
Expand All @@ -50,7 +50,7 @@ For the latest version of this document, please see [https://github.com/haskell/

In addition to `Maybe` (and `Option`) fields the `Data.Monoid.First` and `Data.Monoid.Last` are also omitted,
as well as the most newtype wrappers, when their wrap omittable type (e.g. newtypes in `Data.Monoid` and `Data.Semigroup`, `Identity`, `Const`, `Tagged`, `Compose`).
Additionall "boring" types like `()` and `Proxy` are omitted as well.
Additional "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:
Expand All @@ -68,7 +68,7 @@ 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 space between time and timezone offset (in `UTCTime` and `ZonedTime`) is disallowed. ISO8601 explicitly 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 internal `Data.Aeson.Internal` and `Data.Aeson.Internal.Time` modules. Everything from the former is exported elsewhere (`Data.Aeson.Types`), the latter was truly internal.
Expand Down Expand Up @@ -231,7 +231,7 @@ instance FromJSON Foo where
parseJSON = gParseJSON defaultOptions { rejectUnknownFields = True }
```

* `FromJSON` instance of `Ratio a` now parses numbers in addtion to
* `FromJSON` instance of `Ratio a` now parses numbers in addition to
standard `{numerator=..., denumerator=...}` encoding. Thanks to
Aleksey Khudyakov.

Expand Down
4 changes: 2 additions & 2 deletions src/Data/Aeson/Decoding.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Convertion to and from @aeson@ 'A.Value'.
--
-- | Conversion to and from @aeson@ 'A.Value'.
--
module Data.Aeson.Decoding (
decode,
eitherDecode,
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Aeson/Decoding/Conversion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ convertR tkr err kont = goR [] tkr err $ kont . KM.fromList where
-> (e -> r)
-> ([(Key, A.Value)] -> k -> r)
-> r
-- here we don't stricly need bang on !v as KM is a Strict (in values) map.
-- here we don't strictly need bang on !v as KM is a Strict (in values) map.
-- but we force the value sooner.
goR !acc (TkPair t toks) g f = convert toks g $ \ !v k -> goR ((t , v) : acc) k g f
goR !acc (TkRecordEnd k) _ f = f acc k
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Aeson/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ parseRecord jc tvMap argTys opts tName conName fields obj inTaggedObject =
| (field, argTy) <- zip fields argTys
]

-- A hack, as I'm too lazy to changge code to not assume fields are non empty.
-- A hack, as I'm too lazy to change code to not assume fields are non empty.
nonEmpty :: [a] -> (a, [a])
nonEmpty (x:xs) = (x,xs)
nonEmpty [] = error "unexpected empty list"
Expand Down Expand Up @@ -1276,7 +1276,7 @@ dispatchFunByType _ jf _ tvMap list (VarT tyName) =
varE $ case M.lookup tyName tvMap of
Just (tfjoExp, tfjExp, tfjlExp) -> case list of
Omit -> tfjoExp
Single -> tfjExp
Single -> tfjExp
Plural -> tfjlExp
Nothing -> jsonFunValOrListName list jf Arity0
dispatchFunByType jc jf conName tvMap list (SigT ty _) =
Expand Down
2 changes: 1 addition & 1 deletion tests/DoubleToScientific.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ initialStartValues v = lowerBoundaryCloser' $ applyExponent e S
(s, e, lower_boundary_is_closer) = decodeFloat' v
lowerBoundaryCloser' = if lower_boundary_is_closer then lowerBoundaryCloser else id

-- | return significant, exponent and whether lower boundery is closer.
-- | return significand, exponent and whether lower boundary is closer.
--
-- GHC's decodeFloat does "weird" stuff to denormal doubles,
-- that messes up our delta calculation.
Expand Down
3 changes: 2 additions & 1 deletion tests/UnitTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ camelFrom c s = case split c s of
_ -> s -- shouldn't happen?
where
split c' s' = map L.unpack $ L.split c' $ L.pack s'
capitalize t = toUpper (head t) : tail t
capitalize [] = []
capitalize (x:xs) = toUpper x : xs


data Wibble = Wibble {
Expand Down
Loading