diff --git a/benchmarks/bench/UnescapePureText1.hs b/benchmarks/bench/UnescapePureText1.hs index 9def9a1c..a0f55ac9 100644 --- a/benchmarks/bench/UnescapePureText1.hs +++ b/benchmarks/bench/UnescapePureText1.hs @@ -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 diff --git a/benchmarks/bench/UnescapePureText2.hs b/benchmarks/bench/UnescapePureText2.hs index 0bb4d9eb..5c5766f8 100644 --- a/benchmarks/bench/UnescapePureText2.hs +++ b/benchmarks/bench/UnescapePureText2.hs @@ -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 diff --git a/changelog.md b/changelog.md index c223a87f..2863c933 100644 --- a/changelog.md +++ b/changelog.md @@ -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 @@ -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: @@ -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. @@ -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. diff --git a/src/Data/Aeson/Decoding.hs b/src/Data/Aeson/Decoding.hs index 6ded5723..d9f4a466 100644 --- a/src/Data/Aeson/Decoding.hs +++ b/src/Data/Aeson/Decoding.hs @@ -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, diff --git a/src/Data/Aeson/Decoding/Conversion.hs b/src/Data/Aeson/Decoding/Conversion.hs index ff256fdf..0d9b58e3 100644 --- a/src/Data/Aeson/Decoding/Conversion.hs +++ b/src/Data/Aeson/Decoding/Conversion.hs @@ -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 diff --git a/src/Data/Aeson/TH.hs b/src/Data/Aeson/TH.hs index beaffc58..b4f3636a 100644 --- a/src/Data/Aeson/TH.hs +++ b/src/Data/Aeson/TH.hs @@ -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" @@ -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 _) = diff --git a/tests/DoubleToScientific.hs b/tests/DoubleToScientific.hs index b50d1b9a..dc05b601 100644 --- a/tests/DoubleToScientific.hs +++ b/tests/DoubleToScientific.hs @@ -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. diff --git a/tests/UnitTests.hs b/tests/UnitTests.hs index c9dda427..91bc0245 100644 --- a/tests/UnitTests.hs +++ b/tests/UnitTests.hs @@ -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 {