CouchDB-1.2.3: CouchDB interface
Database.CouchDB.JSON
Description
Convenient functions for parsing JSON responses. Use these functions to write the readJSON method of the JSON class.
readJSON
JSON
jsonString :: JSValue -> Result String Source #
jsonInt :: Integral n => JSValue -> Result n Source #
jsonObject :: JSValue -> Result [(String, JSValue)] Source #
jsonField :: JSON a => String -> [(String, JSValue)] -> Result a Source #
Extract a field as a value of type a. If the field does not exist or cannot be parsed as type a, fail.
a
jsonBool :: JSValue -> Result Bool Source #
jsonIsTrue :: String -> [(String, JSValue)] -> Result Bool Source #
True when the field is defined and is true. Otherwise, False.
True
False