json-tools 0.3.0 → 0.3.1
raw patch · 2 files changed
+2/−2 lines, 2 files
Files
- json-tools.cabal +1/−1
- json-wrap.hs +1/−1
json-tools.cabal view
@@ -1,6 +1,6 @@ Name: json-tools Cabal-Version: >=1.6-Version: 0.3.0+Version: 0.3.1 License: BSD3 License-File: LICENSE Copyright: (c) Nicolas Pouillard
json-wrap.hs view
@@ -8,7 +8,7 @@ -- wrap, as in line-wrapping main :: IO ()-main = mapM_ S.putStrLn . ($[]) . f . either err id . parseJSON =<< S.getContents+main = mapM_ S.putStr . ($["\n"]) . f . either err id . parseJSON =<< S.getContents where f (JSArray a) = t"[" . cat (intersperse (t"\n,") (map (t . showJSON) a)) . t"]" f (JSObject o) = t"{" . cat (intersperse (t"\n,") (map g . toList $ o)) . t"}" f _ = error "impossible by decodeStrict post-condition"