moltapContentsIndex
Moltap.Util.SimpleJSON
Portabilityportable
Stabilityexperimental
Maintainertwanvl@gmail.com
Description
A very simple output library for JSON (JavaScript Object Notation).
Synopsis
data JSON
= JSONString String
| JSONInt Int
| JSONBool Bool
| JSONList [JSON]
| JSONObject [JSONKeyVal]
data JSONKeyVal
(=:) :: ToJSON a => String -> a -> JSONKeyVal
class ToJSON a where
toJSON :: a -> JSON
toJSONList :: [a] -> JSON
Documentation
data JSON

JSON data.

The data can be converted to actual JSON notation using show.

Constructors
JSONString String
JSONInt Int
JSONBool Bool
JSONList [JSON]
JSONObject [JSONKeyVal]
show/hide Instances
data JSONKeyVal
A JSON key/value pair, a list of these forms an object.
show/hide Instances
(=:) :: ToJSON a => String -> a -> JSONKeyVal

Create a key/value pair for in a JSONObject.

Objects can be constructed using

 ["x" =: value1, "y" =: value2]

Which converts to

 {x: value1, y: value2}
class ToJSON a where
Things that can be converted to JSON
Methods
toJSON :: a -> JSON
Convert a value to JSON
toJSONList :: [a] -> JSON
Convert a list to JSON
show/hide Instances
Produced by Haddock version 0.8