json-0.4.4: Support for serialising Haskell to and from JSONSource codeContentsIndex
Text.JSON.String
Portabilityportable
Stabilityprovisional
MaintainerSigbjorn Finne <sof@galois.com>
Contents
Parsing
Reading JSON
Writing JSON
Description
Synopsis
data GetJSON a
runGetJSON :: GetJSON a -> String -> Either String a
readJSNull :: GetJSON JSValue
readJSBool :: GetJSON JSValue
readJSString :: GetJSON JSValue
readJSRational :: GetJSON Rational
readJSArray :: GetJSON JSValue
readJSObject :: GetJSON JSValue
readJSValue :: GetJSON JSValue
readJSTopType :: GetJSON JSValue
showJSNull :: ShowS
showJSBool :: Bool -> ShowS
showJSArray :: [JSValue] -> ShowS
showJSObject :: JSObject JSValue -> ShowS
showJSRational :: Rational -> ShowS
showJSRational' :: Bool -> Rational -> ShowS
showJSValue :: JSValue -> ShowS
showJSTopType :: JSValue -> ShowS
Parsing
data GetJSON a Source

Parsing JSON

The type of JSON parsers for String

runGetJSON :: GetJSON a -> String -> Either String aSource
Run a JSON reader on an input String, returning some Haskell value. All input will be consumed.
Reading JSON
readJSNull :: GetJSON JSValueSource
Read the JSON null type
readJSBool :: GetJSON JSValueSource
Read the JSON Bool type
readJSString :: GetJSON JSValueSource
Read the JSON String type
readJSRational :: GetJSON RationalSource
Read an Integer or Double in JSON format, returning a Rational
readJSArray :: GetJSON JSValueSource
Read a list in JSON format
readJSObject :: GetJSON JSValueSource
Read an object in JSON format
readJSValue :: GetJSON JSValueSource
Read one of several possible JS types
readJSTopType :: GetJSON JSValueSource
Top level JSON can only be Arrays or Objects
Writing JSON
showJSNull :: ShowSSource
Write the JSON null type
showJSBool :: Bool -> ShowSSource
Write the JSON Bool type
showJSArray :: [JSValue] -> ShowSSource
Show a list in JSON format
showJSObject :: JSObject JSValue -> ShowSSource
Show an association list in JSON format
showJSRational :: Rational -> ShowSSource
Show a Rational in JSON format
showJSRational' :: Bool -> Rational -> ShowSSource
showJSValue :: JSValue -> ShowSSource
Show JSON values
showJSTopType :: JSValue -> ShowSSource

Writing JSON

Show strict JSON top level types. Values not permitted at the top level are wrapped in a singleton array.

Produced by Haddock version 2.6.0