aeson-qq 0.8.2 → 0.8.4
raw patch · 3 files changed
Files
- aeson-qq.cabal +23/−19
- src/Data/Aeson/QQ.hs +3/−2
- src/Data/JSON/QQ.hs +1/−1
aeson-qq.cabal view
@@ -1,9 +1,11 @@--- This file has been generated from package.yaml by hpack version 0.18.0.+cabal-version: 1.12++-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack name: aeson-qq-version: 0.8.2+version: 0.8.4 synopsis: JSON quasiquoter for Haskell description: @aeson-qq@ provides a JSON quasiquoter for Haskell. .@@ -23,7 +25,6 @@ maintainer: Simon Hengel <sol@typeful.net> category: JSON build-type: Simple-cabal-version: >= 1.10 source-repository head type: git@@ -40,20 +41,22 @@ Paths_aeson_qq default-language: Haskell2010 build-depends:- base >= 4.5 && < 5- , base-compat- , text+ aeson >=0.6 , attoparsec- , scientific- , vector- , aeson >= 0.6+ , base >=4.5 && <5+ , base-compat+ , haskell-src-meta >=0.1.0 , parsec+ , scientific , template-haskell- , haskell-src-meta >= 0.1.0+ , text+ , vector test-suite spec type: exitcode-stdio-1.0 ghc-options: -Wall+ build-tool-depends:+ hspec-discover:hspec-discover hs-source-dirs: src test@@ -64,17 +67,18 @@ Data.Aeson.QQSpec Data.JSON.QQSpec Person+ Paths_aeson_qq default-language: Haskell2010 build-depends:- base >= 4.5 && < 5- , base-compat- , text+ aeson >=0.6 , attoparsec- , scientific- , vector- , aeson >= 0.6+ , base >=4.5 && <5+ , base-compat+ , ghc-prim+ , haskell-src-meta >=0.1.0+ , hspec , parsec+ , scientific , template-haskell- , haskell-src-meta >= 0.1.0- , hspec- , ghc-prim+ , text+ , vector
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|]
src/Data/JSON/QQ.hs view
@@ -75,7 +75,7 @@ d <- many digit return $ o:d - convert :: Monad m => String -> m Scientific+ convert :: String -> Parser Scientific convert = either fail return . A.parseOnly (A.scientific <* A.endOfInput) . T.pack jpObject :: JsonParser