summaryrefslogtreecommitdiff
path: root/Messages/JSON.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Messages/JSON.hs')
-rw-r--r--Messages/JSON.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/Messages/JSON.hs b/Messages/JSON.hs
index ee6ea34a3..fb95f550e 100644
--- a/Messages/JSON.hs
+++ b/Messages/JSON.hs
@@ -8,9 +8,12 @@
module Messages.JSON (
start,
end,
- note
+ note,
+ add
) where
+import Text.JSON
+
import qualified Utility.JSONStream as Stream
start :: String -> String -> IO ()
@@ -20,4 +23,7 @@ end :: Bool -> IO ()
end b = putStr $ Stream.add [("success", b)] ++ Stream.end
note :: String -> IO ()
-note s = putStr $ Stream.add [("note", s)]
+note s = add [("note", s)]
+
+add :: JSON a => [(String, a)] -> IO ()
+add v = putStr $ Stream.add v