json-builder 0.2.4 → 0.2.5
raw patch · 4 files changed
+27/−6 lines, 4 files
Files
- json-builder.cabal +3/−3
- src/Data/Json/Builder.hs +1/−1
- src/Data/Json/Builder/Implementation.hs +22/−1
- src/Data/Json/Builder/Internal.hs +1/−1
json-builder.cabal view
@@ -1,12 +1,12 @@ Name: json-builder-Version: 0.2.4+Version: 0.2.5 Synopsis: Data structure agnostic JSON serialization License: BSD3 License-file: LICENSE Author: Leon P Smith Maintainer: leon@melding-monads.com Stability: experimental-Copyright: (c) 2011 Leon P Smith+Copyright: (c) 2011-2012 Leon P Smith Category: JSON Build-type: Simple Cabal-version: >= 1.6@@ -47,4 +47,4 @@ source-repository this type: git location: http://github.com/lpsmith/json-builder- tag: v0.2.4+ tag: v0.2.5
src/Data/Json/Builder.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module : Data.Json.Builder--- Copyright : (c) 2011 Leon P Smith+-- Copyright : (c) 2011-2012 Leon P Smith -- License : BSD3 -- -- Maintainer : Leon P Smith <leon@melding-monads.com>
src/Data/Json/Builder/Implementation.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module : Data.Json.Builder.Implementation--- Copyright : (c) 2011 Leon P Smith+-- Copyright : (c) 2011-2012 Leon P Smith -- License : BSD3 -- -- Maintainer : Leon P Smith <leon@melding-monads.com>@@ -327,6 +327,27 @@ instance (JsString k, Value a) => JsObject (HashMap.HashMap k a) where toObject = HashMap.foldrWithKey (\k a b -> row k a ++ b) mempty++instance (Value a, Value b) => JsArray (a,b) where+ toArray (a,b) = element a ++ element b++-- | renders as an 'Array'+instance (Value a, Value b) => Value (a,b) where+ toJson = toJson . toArray++instance (Value a, Value b, Value c) => JsArray (a,b,c) where+ toArray (a,b,c) = element a ++ element b ++ element c++-- | renders as an 'Array'+instance (Value a, Value b, Value c) => Value (a,b,c) where+ toJson = toJson . toArray++instance (Value a, Value b, Value c, Value d) => JsArray (a,b,c,d) where+ toArray (a,b,c,d) = element a ++ element b ++ element c ++ element d++-- | renders as an 'Array'+instance (Value a, Value b, Value c, Value d) => Value (a,b,c,d) where+ toJson = toJson . toArray ------------------------------------------------------------------------------
src/Data/Json/Builder/Internal.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module : Data.Json.Builder.Internal--- Copyright : (c) 2011 Leon P Smith+-- Copyright : (c) 2011-2012 Leon P Smith -- License : BSD3 -- -- Maintainer : Leon P Smith <leon@melding-monads.com>