Parse a strict ByteString to a JSON.Value directly using eitherDecodeStrict
commit9f2e4d007a9560e2fe619202c53a1f89fb0c5ec8
authorBas van Dijk <v.dijk.bas@gmail.com>
dateSun 15 Sep 2013, 11:19 (13 years ago)
parent2b963a8
postgresql-simple.cabal+1−1
@@ -52,7 +52,7 @@ Library
5252 Database.PostgreSQL.Simple.TypeInfo.Types
5353
5454 Build-depends:
55− aeson >= 0.6,
55+ aeson >= 0.6.2,
5656 attoparsec >= 0.10.3,
5757 base < 5,
5858 blaze-builder,
src/Database/PostgreSQL/Simple/FromField.hs+1−1
@@ -452,7 +452,7 @@ instance FromField JSON.Value where
452452 else case mbs of
453453 Nothing -> returnError UnexpectedNull f ""
454454 Just bs ->
455− case JSON.eitherDecode' $ LB.fromChunks [bs] of
455+ case JSON.eitherDecodeStrict' bs of
456456 Left err -> returnError ConversionFailed f err
457457 Right val -> pure val
458458