aeson-qq 0.8.3 → 0.8.4
raw patch · 2 files changed
+7/−6 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- aeson-qq.cabal +4/−4
- src/Data/Aeson/QQ.hs +3/−2
aeson-qq.cabal view
@@ -1,13 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.32.0.+-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack------ hash: a1f241da60cf8a9d7982813256a1f34533b63be4d8adaeef03e78814369707c4 name: aeson-qq-version: 0.8.3+version: 0.8.4 synopsis: JSON quasiquoter for Haskell description: @aeson-qq@ provides a JSON quasiquoter for Haskell. .@@ -57,6 +55,8 @@ test-suite spec type: exitcode-stdio-1.0 ghc-options: -Wall+ build-tool-depends:+ hspec-discover:hspec-discover hs-source-dirs: src test
src/Data/Aeson/QQ.hs view
@@ -10,6 +10,7 @@ import Language.Haskell.TH.Quote import qualified Data.Vector as V+import Data.String (fromString) import qualified Data.Text as T import Data.Aeson @@ -46,8 +47,8 @@ objs2list :: (HashKey, JsonValue) -> ExpQ objs2list (key, value) = do case key of- HashStringKey k -> [|(T.pack k, $(toExp value))|]- HashVarKey k -> [|(T.pack $(dyn k), $(toExp value))|]+ HashStringKey k -> [|(fromString k, $(toExp value))|]+ HashVarKey k -> [|(fromString $(dyn k), $(toExp value))|] toExp (JsonArray arr) = [|Array $ V.fromList $(ListE <$> mapM toExp arr)|] toExp (JsonNumber n) = [|Number (fromRational $(return $ LitE $ RationalL (toRational n)))|] toExp (JsonBool b) = [|Bool b|]