|
ContentsBasic functionstoJsonString :: Json a => a -> String Converts the value to a string encoded with JSON fromJsonString :: Json a => String -> a Parses a JSON encoded string into a value Supported value typesThis module supports the following value types:
Generic JSON Typedata Json A JSON value held in memory as a tree. Numbers are kept as either JsonString :: String -> Json JsonDouble :: Double -> Json JsonLong :: Long -> Json JsonArray :: [Json] -> Json JsonBoolean :: Boolean -> Json JsonNull :: Json JsonObject :: [JsonField] -> Json data JsonField One field of a JSON object: its name and its value. JsonField :: String -> Json -> JsonField Adding support for additional value typesdata JsonGenerator A sink that JSON is written to as a stream of tokens, one value at a time,
so that a document never has to be held in memory as a whole. It is what
the data JsonParser A source that JSON is read from as a stream of tokens, one value at a time,
so that a document never has to be held in memory as a whole. It is what
the class Json a The class of types whose values can be encoded as JSON and decoded back.
Methods The comment at the top of this module shows how an instance is written. writeJson :: Json a => JsonGenerator -> a -> <Proc> () Writes the value directly to the generator, without building a readJson :: Json a => JsonParser -> <Proc> a Reads a value from the parser, starting at the token the parser is
currently on, without building a toJson :: Json a => a -> Json The value as a fromJson :: Json a => Json -> a The value that the It is enough to implement Undocumented entitieslookupJsonField :: String -> Json -> Maybe Json The value of the named field of a JSON object, or |