rest-gen 0.10.0.3 → 0.10.0.4
raw patch · 3 files changed
+9/−5 lines, 3 filesdep +scientificdep −aeson-utilsPVP ok
version bump matches the API change (PVP)
Dependencies added: scientific
Dependencies removed: aeson-utils
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- rest-gen.cabal +2/−2
- src/Rest/Gen/Base/JSON/Pretty.hs +3/−3
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Changelog +#### 0.10.0.4++* Drops `aeson-utils` dependency in favor of `scientific >= 0.3.2`+ #### 0.10.0.3 * Allow `mtl == 2.2.*`
rest-gen.cabal view
@@ -1,5 +1,5 @@ name: rest-gen-version: 0.10.0.3+version: 0.10.0.4 description: Documentation and client generation from rest definition. synopsis: Documentation and client generation from rest definition. maintainer: code@silk.co@@ -50,7 +50,6 @@ , Cabal >= 1.18 && < 1.22 , HStringTemplate >= 0.6 && < 0.8 , aeson >= 0.7 && < 0.8- , aeson-utils == 0.2.* , attoparsec >= 0.10 && < 0.12 , blaze-html >= 0.5 && < 0.8 , bytestring >= 0.9 && < 0.11@@ -72,6 +71,7 @@ , rest-core >= 0.29 && < 0.31 , rest-types == 1.10.* , safe >= 0.2 && < 0.4+ , scientific >= 0.3.2 && < 0.4 , split >= 0.1 && < 0.3 , tagged >= 0.2 && < 0.8 , text >= 0.11 && < 1.2
src/Rest/Gen/Base/JSON/Pretty.hs view
@@ -2,20 +2,20 @@ import Control.Arrow (first) import Data.Aeson.Types-import Data.Aeson.Utils (parseNumber) import Data.Char import Data.HashMap.Strict (HashMap)+import Data.Scientific (floatingOrInteger) import Data.Text (Text, unpack) import Numeric import Text.PrettyPrint.HughesPJ hiding (first) import qualified Data.HashMap.Strict as H-import qualified Data.Vector as V+import qualified Data.Vector as V pp_value :: Value -> Doc pp_value v = case v of Null -> pp_null Bool x -> pp_boolean x- Number x -> pp_number (parseNumber x)+ Number x -> pp_number . either Right Left . floatingOrInteger $ x String x -> pp_js_string (unpack x) Array vs -> pp_array $ V.toList vs Object xs -> pp_js_object xs