core-data 0.3.9.0 → 0.3.9.1
raw patch · 2 files changed
+14/−9 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- core-data.cabal +3/−3
- lib/Core/Encoding/Json.hs +11/−6
core-data.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: core-data-version: 0.3.9.0+version: 0.3.9.1 synopsis: Convenience wrappers around common data structures and encodings description: Wrappers around common data structures and encodings. .@@ -21,12 +21,12 @@ bug-reports: https://github.com/aesiniath/unbeliever/issues author: Andrew Cowie <istathar@gmail.com> maintainer: Andrew Cowie <istathar@gmail.com>-copyright: © 2018-2022 Athae Eredh Siniath and Others+copyright: © 2018-2023 Athae Eredh Siniath and Others license: MIT license-file: LICENSE build-type: Simple tested-with:- GHC == 8.10.7, GHC == 9.2.4+ GHC == 8.10.7, GHC == 9.2.5 source-repository head type: git
lib/Core/Encoding/Json.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE ImportQualifiedPost #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE StrictData #-}@@ -100,11 +101,11 @@ , breakRope ) import Data.Aeson (FromJSON, Value (String))-import qualified Data.Aeson as Aeson+import Data.Aeson qualified as Aeson import Data.Char (intToDigit) import Data.Coerce import Data.Hashable (Hashable)-import qualified Data.List as List+import Data.List qualified as List import Data.Scientific ( FPFormat (..) , Scientific@@ -112,8 +113,8 @@ , isFloating ) import Data.String (IsString (..))-import qualified Data.Text as T-import qualified Data.Vector as V+import Data.Text qualified as T+import Data.Vector qualified as V import GHC.Generics import Prettyprinter ( Doc@@ -134,7 +135,6 @@ , rbracket , sep , unAnnotate- , viaShow , vsep , (<+>) )@@ -425,7 +425,12 @@ annotate QuoteToken dquote <> annotate StringToken (escapeText x) <> annotate QuoteToken dquote- JsonNumber x -> annotate NumberToken (viaShow x)+ JsonNumber x ->+ let num =+ if isFloating x+ then pretty (formatScientific Generic Nothing x)+ else pretty (formatScientific Fixed (Just 0) x)+ in annotate NumberToken num JsonBool x -> case x of True -> annotate BooleanToken "true" False -> annotate BooleanToken "false"