pa-json 0.1.1.0 → 0.1.1.1
raw patch · 2 files changed
+6/−6 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- pa-json.cabal +1/−1
- src/Json/Enc.hs +5/−5
pa-json.cabal view
@@ -1,7 +1,7 @@ cabal-version: 3.0 -- !!! ATTN: file autogenerated from pa-template.cabal.mustache on toplevel !!! name: pa-json-version: 0.1.1.0+version: 0.1.1.1 synopsis: Our JSON parsers/encoders description: The interface of `aeson` is unfortunately extremely … suboptimal. Here’s some wrappers trying to improve the situation, which we use internally. license: BSD-3-Clause
src/Json/Enc.hs view
@@ -44,7 +44,7 @@ -- | You can create an @Enc any@ that renders an 'Aeson.Number' value with an floating point literal. ----- ATTN: Bear in mind that this will crash on repeating rationals, so only use for literals in code!+-- __ATTN__: Bear in mind that this will crash on repeating rationals, so only use for literals in code! instance RationalLiteral Enc where rationalLiteral r = Enc $ AesonEnc.scientific (r & fromRational @Scientific) @@ -57,6 +57,8 @@ encToBytesUtf8Lazy enc = enc.unEnc & Json.Enc.encodingToLazyByteString -- | Convert an 'Enc' to a strict Text which is valid JSON (prettyfied).+--+-- __ATTN__: will re-parse the json through `Value`, so only use for user-interactions like pretty-printing. encToTextPretty :: Enc -> Text encToTextPretty enc = enc@@ -64,6 +66,8 @@ & toStrict -- | Convert an 'Enc' to a lazy Text which is valid JSON (prettyfied).+--+-- __ATTN__: will re-parse the json through `Value`, so only use for user-interactions like pretty-printing. encToTextPrettyLazy :: Enc -> Lazy.Text encToTextPrettyLazy enc = enc@@ -74,8 +78,6 @@ & Aeson.Pretty.encodePrettyToTextBuilder & Text.Builder.toLazyText --- | * Encoders- -- | Embed an 'Encoding' verbatim (it’s a valid JSON value) encoding :: Encoding -> Enc encoding = Enc@@ -221,8 +223,6 @@ utcTime :: Time.UTCTime -> Enc utcTime = text . stringToText . ISO8601.iso8601Show @Time.UTCTime---- | * Helpers -- | Implement this class if you want your type to only implement the part of 'Num' -- that allows creating them from Integer-literals, then derive Num via 'NumLiteralOnly':