aeson-0.6.0.2: Fast JSON parsing and encoding

Portabilityportable
Stabilityexperimental
MaintainerBryan O'Sullivan <bos@serpentine.com>
Safe HaskellSafe-Infered

Data.Aeson.Types.Internal

Contents

Description

Types for working with JSON data.

Synopsis

Core JSON types

data Value Source

A JSON value represented as a Haskell value.

type Array = Vector ValueSource

A JSON "array" (sequence).

emptyArray :: ValueSource

The empty array.

isEmptyArray :: Value -> BoolSource

Determines if the Value is an empty Array. Note that: isEmptyArray emptyArray.

type Pair = (Text, Value)Source

A key/value pair for an Object.

type Object = HashMap Text ValueSource

A JSON "object" (key/value map).

emptyObject :: ValueSource

The empty object.

Type conversion

data Parser a Source

A continuation-based parser type.

data Result a Source

The result of running a Parser.

Constructors

Error String 
Success a 

parse :: (a -> Parser b) -> a -> Result bSource

Run a Parser.

parseEither :: (a -> Parser b) -> a -> Either String bSource

Run a Parser with an Either result type.

parseMaybe :: (a -> Parser b) -> a -> Maybe bSource

Run a Parser with a Maybe result type.

Constructors and accessors

object :: [Pair] -> ValueSource

Create a Value from a list of name/value Pairs. If duplicate keys arise, earlier keys and their associated values win.