aeson-2.1.2.1: Fast JSON parsing and encoding
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Aeson.Decoding

Description

Convertion to and from aeson Value.

Synopsis

Documentation

decode :: FromJSON a => ByteString -> Maybe a Source #

Efficiently deserialize a JSON value from a strict ByteString. If this fails due to incomplete or invalid input, Nothing is returned.

eitherDecode :: FromJSON a => ByteString -> Either String a Source #

Like decodeStrict but returns an error message when decoding fails.

throwDecode :: forall a m. (FromJSON a, MonadThrow m) => ByteString -> m a Source #

Like decode but throws an AesonException when decoding fails.

decodeStrict :: FromJSON a => ByteString -> Maybe a Source #

Efficiently deserialize a JSON value from a strict ByteString. If this fails due to incomplete or invalid input, Nothing is returned.

eitherDecodeStrict :: FromJSON a => ByteString -> Either String a Source #

Like decodeStrict but returns an error message when decoding fails.

throwDecodeStrict :: forall a m. (FromJSON a, MonadThrow m) => ByteString -> m a Source #

Like decodeStrict but throws an AesonException when decoding fails.

toEitherValue Source #

Arguments

:: Tokens k e

tokens

-> Either e (Value, k)

either token error or value and leftover.

Convert Tokens to Value.