|
Text.JSON | Portability | portable | Stability | provisional | Maintainer | Sigbjorn Finne <sof@galois.com> |
|
|
|
|
|
Description |
|
|
Synopsis |
|
|
|
|
JSON Types
|
|
|
JSON values
The type to which we encode Haskell values. There's a set
of primitives, and a couple of heterogenous collection types.
Objects:
An object structure is represented as a pair of curly brackets
surrounding zero or more name/value pairs (or members). A name is a
string. A single colon comes after each name, separating the name
from the value. A single comma separates a value from a
following name.
Arrays:
An array structure is represented as square brackets surrounding
zero or more values (or elements). Elements are separated by commas.
Only valid JSON can be constructed this way
| Constructors | |
|
|
Serialization to and from JSValues
|
|
|
The class of types serialisable to and from JSON
| | Methods | |
|
|
Encoding and Decoding
|
|
|
A type for parser results
| Constructors | |
|
|
|
Encode a Haskell value into a string, in JSON format.
This is a superset of JSON, as types other than
Array and Object are allowed at the top level.
|
|
|
Decode a String representing a JSON value
(either an object, array, bool, number, null)
This is a superset of JSON, as types other than
Array and Object are allowed at the top level.
|
|
|
Encode a value as a String in strict JSON format.
This follows the spec, and requires all values
at the top level to be wrapped in either an Array or Object.
JSON types to be an Array or Object.
|
|
|
Decode a String representing a strict JSON value.
This follows the spec, and requires top level
JSON types to be an Array or Object.
|
|
Wrapper Types
|
|
|
Strings can be represented a little more efficiently in JSON
|
|
|
|
Turn a Haskell string into a JSON string.
|
|
|
|
|
|
|
|
Make JSON object out of an association list.
|
|
|
|
|
Map Results to Eithers
|
|
Serialization to and from Strings.
|
|
Reading JSON
|
|
|
Read the JSON null type
|
|
|
Read the JSON Bool type
|
|
|
Read the JSON String type
|
|
|
Read an Integer or Double in JSON format, returning a Rational
|
|
|
Read a list in JSON format
|
|
|
Read an object in JSON format
|
|
|
Read one of several possible JS types
|
|
Writing JSON
|
|
|
Write the JSON null type
|
|
|
Write the JSON Bool type
|
|
|
Show a list in JSON format
|
|
|
Show a Rational in JSON format
|
|
|
|
|
Show an association list in JSON format
|
|
|
Show JSON values
|
|
Instance helpers
|
|
|
|
|
Pull a value out of a JSON object.
|
|
Produced by Haddock version 2.6.0 |