aeson-1.4.0.0: Fast JSON parsing and encoding

Copyright (c) 2011-2016 Bryan O'Sullivan(c) 2011 MailRank Inc. BSD3 Bryan O'Sullivan experimental portable None Haskell2010

Data.Aeson.Parser.Internal

Description

Efficiently and correctly parse a JSON string. The string must be encoded as UTF-8.

Synopsis

# Lazy parsers

Parse a top-level JSON value.

The conversion of a parsed value to a Haskell value is deferred until the Haskell value is needed. This may improve performance if only a subset of the results of conversions are needed, but at a cost in thunk allocation.

This function is an alias for value. In aeson 0.8 and earlier, it parsed only object or array types, in conformance with the now-obsolete RFC 4627.

Parse a top-level JSON value followed by optional whitespace and end-of-input. See also: json.

Parse any JSON value. You should usually json in preference to this function, as this function relaxes the object-or-array requirement of RFC 4627.

In particular, be careful in using this function if you think your code might interoperate with Javascript. A naïve Javascript library that parses JSON data using eval is vulnerable to attack unless the encoded data represents an object or an array. JSON implementations in other languages conform to that same restriction to preserve interoperability and security.

Parse a quoted JSON string.

Parse a string without a leading quote.

Parse a JSON number.

# Strict parsers

Parse a top-level JSON value.

This is a strict version of json which avoids building up thunks during parsing; it performs all conversions immediately. Prefer this version if most of the JSON data needs to be accessed.

This function is an alias for value'. In aeson 0.8 and earlier, it parsed only object or array types, in conformance with the now-obsolete RFC 4627.

Parse a top-level JSON value followed by optional whitespace and end-of-input. See also: json'.

Strict version of value. See also json'.