CouchDB-0.8.0.2: CouchDB interfaceSource codeContentsIndex
Database.CouchDB.JSON
Description
Convenient functions for parsing JSON responses. Use these functions to write the readJSON method of the JSON class.
Synopsis
jsonString :: JSValue -> Result String
jsonInt :: Integral n => JSValue -> Result n
jsonObject :: JSValue -> Result [(String, JSValue)]
jsonField :: JSON a => String -> [(String, JSValue)] -> Result a
jsonBool :: JSValue -> Result Bool
jsonIsTrue :: String -> [(String, JSValue)] -> Result Bool
Documentation
jsonString :: JSValue -> Result StringSource
jsonInt :: Integral n => JSValue -> Result nSource
jsonObject :: JSValue -> Result [(String, JSValue)]Source
jsonField :: JSON a => String -> [(String, JSValue)] -> Result aSource
Extract a field as a value of type a. If the field does not exist or cannot be parsed as type a, fail.
jsonBool :: JSValue -> Result BoolSource
jsonIsTrue :: String -> [(String, JSValue)] -> Result BoolSource
True when the field is defined and is true. Otherwise, False.
Produced by Haddock version 2.3.0