aeson-0.10.0.0: Fast JSON parsing and encoding

Copyright | (c) 2015 Bryan O'Sullivan
License | Apache
Maintainer | Bryan O'Sullivan <bos@serpentine.com>
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell98

Data.Aeson.Internal

Description

Internal types and functions.

Note: all declarations in this module are unstable, and prone to being changed at any time.

Synopsis

- data IResult a
  - = IError JSONPath String
  - | ISuccess a
- data JSONPathElement
- type JSONPath = [JSONPathElement]
- formatError :: JSONPath -> String -> String
- ifromJSON :: FromJSON a => Value -> IResult a
- iparse :: (a -> Parser b) -> a -> IResult b

# Documentation

data IResult a

The internal result of running a `Parser`.

Constructors

IError JSONPath String |
ISuccess a |

Instances

Monad IResult |
Functor IResult |
Applicative IResult |
Foldable IResult |
Traversable IResult |
Alternative IResult |
MonadPlus IResult |
Eq a => Eq (IResult a) |
Show a => Show (IResult a) |
Monoid (IResult a) |
NFData a => NFData (IResult a) |

data JSONPathElement

Elements of a JSON path used to describe the location of an error.

Instances

Eq JSONPathElement |
Show JSONPathElement |
NFData JSONPathElement |

type JSONPath = [JSONPathElement]

formatError :: JSONPath -> String -> String

Annotate an error message with a JSONPath error location.

ifromJSON :: FromJSON a => Value -> IResult a

Convert a value from JSON, failing if the types do not match.

iparse :: (a -> Parser b) -> a -> IResult b

Run a `Parser`.