json 0.6 → 0.7
raw patch · 2 files changed
+12/−2 lines, 2 filesdep +textPVP ok
version bump matches the API change (PVP)
Dependencies added: text
API changes (from Hackage documentation)
+ Text.JSON: instance JSON Text
Files
- Text/JSON.hs +10/−0
- json.cabal +2/−2
Text/JSON.hs view
@@ -70,6 +70,7 @@ import qualified Data.IntMap as IntMap import qualified Data.Array as Array+import qualified Data.Text as T ------------------------------------------------------------------------ @@ -419,6 +420,15 @@ instance JSON L.ByteString where showJSON = encJSString L.unpack readJSON = decJSString "Lazy.ByteString" (return . L.pack)++-- -----------------------------------------------------------------+-- Data.Text++instance JSON T.Text where+ readJSON (JSString s) = return (T.pack . fromJSString $ s)+ readJSON _ = mkError "Unable to read JSString"+ showJSON = JSString . toJSString . T.unpack+ -- ----------------------------------------------------------------- -- Instance Helpers
json.cabal view
@@ -1,5 +1,5 @@ name: json-version: 0.6+version: 0.7 synopsis: Support for serialising Haskell to and from JSON description: JSON (JavaScript Object Notation) is a lightweight data-interchange@@ -97,7 +97,7 @@ else build-depends: base >= 3 - build-depends: array, containers, bytestring, mtl+ build-depends: array, containers, bytestring, mtl, text if flag(parsec) build-depends: parsec