ghcjs-base-0.2.0.0: base library for GHCJS

Copyright(c) 2011-2013 Bryan O'Sullivan
(c) 2011 MailRank Inc.
LicenseApache
MaintainerBryan O'Sullivan <bos@serpentine.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

JavaScript.JSON.Types.Instances

Contents

Description

Types for working with JSON data.

Synopsis

Type classes

Core JSON classes

class FromJSON a where Source #

Methods

parseJSON :: Value -> Parser a Source #

parseJSON :: (Generic a, GFromJSON (Rep a)) => Value -> Parser a Source #

Instances
FromJSON Bool Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

FromJSON Char Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

FromJSON Double Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

FromJSON Float Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

FromJSON Int Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

FromJSON Int8 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser Int8 Source #

FromJSON Int16 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser Int16 Source #

FromJSON Int32 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser Int32 Source #

FromJSON Int64 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser Int64 Source #

FromJSON Integer Source #

WARNING: Only parse Integers from trusted input since an attacker could easily fill up the memory of the target system by specifying a scientific number with a big exponent like 1e1000000000.

Instance details

Defined in JavaScript.JSON.Types.Instances

FromJSON Word Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

FromJSON Word8 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser Word8 Source #

FromJSON Word16 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser Word16 Source #

FromJSON Word32 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser Word32 Source #

FromJSON Word64 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser Word64 Source #

FromJSON () Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser () Source #

FromJSON Text Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser Text Source #

FromJSON UTCTime Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser UTCTime Source #

FromJSON DotNetTime Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

FromJSON Text Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser Text Source #

FromJSON JSString Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

FromJSON IntSet Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser IntSet Source #

FromJSON ZonedTime Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser ZonedTime Source #

FromJSON Value Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

FromJSON [Char] Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

FromJSON a => FromJSON [a] Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser [a] Source #

FromJSON a => FromJSON (Maybe a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (Maybe a) Source #

FromJSON (Ratio Integer) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (Ratio Integer) Source #

FromJSON a => FromJSON (Last a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (Last a) Source #

FromJSON a => FromJSON (First a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (First a) Source #

FromJSON a => FromJSON (Dual a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (Dual a) Source #

(Eq a, Hashable a, FromJSON a) => FromJSON (HashSet a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

HasResolution a => FromJSON (Fixed a) Source #

WARNING: Only parse fixed-precision numbers from trusted input since an attacker could easily fill up the memory of the target system by specifying a scientific number with a big exponent like 1e1000000000.

Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (Fixed a) Source #

FromJSON a => FromJSON (IntMap a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (IntMap a) Source #

(Ord a, FromJSON a) => FromJSON (Set a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (Set a) Source #

(FromJSON a, FromJSON b) => FromJSON (Either a b) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (Either a b) Source #

(FromJSON a, FromJSON b) => FromJSON (a, b) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b) Source #

(FromJSON a, FromJSON b, FromJSON c) => FromJSON (a, b, c) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b, c) Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d) => FromJSON (a, b, c, d) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b, c, d) Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e) => FromJSON (a, b, c, d, e) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b, c, d, e) Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f) => FromJSON (a, b, c, d, e, f) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f) Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g) => FromJSON (a, b, c, d, e, f, g) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g) Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h) => FromJSON (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h) Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i) => FromJSON (a, b, c, d, e, f, g, h, i) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i) Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j) => FromJSON (a, b, c, d, e, f, g, h, i, j) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i, j) Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k) => FromJSON (a, b, c, d, e, f, g, h, i, j, k) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i, j, k) Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k, FromJSON l) => FromJSON (a, b, c, d, e, f, g, h, i, j, k, l) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i, j, k, l) Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k, FromJSON l, FromJSON m) => FromJSON (a, b, c, d, e, f, g, h, i, j, k, l, m) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i, j, k, l, m) Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k, FromJSON l, FromJSON m, FromJSON n) => FromJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k, FromJSON l, FromJSON m, FromJSON n, FromJSON o) => FromJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source #

class ToJSON a where Source #

Methods

toJSON :: a -> Value Source #

toJSON :: (Generic a, GToJSON (Rep a)) => a -> Value Source #

Instances
ToJSON Bool Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Bool -> Value Source #

ToJSON Char Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Char -> Value Source #

ToJSON Double Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Double -> Value Source #

ToJSON Float Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Float -> Value Source #

ToJSON Int Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Int -> Value Source #

ToJSON Int8 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Int8 -> Value Source #

ToJSON Int16 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Int16 -> Value Source #

ToJSON Int32 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Int32 -> Value Source #

ToJSON Int64 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Int64 -> Value Source #

ToJSON Integer Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Integer -> Value Source #

ToJSON Word Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Word -> Value Source #

ToJSON Word8 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Word8 -> Value Source #

ToJSON Word16 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Word16 -> Value Source #

ToJSON Word32 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Word32 -> Value Source #

ToJSON Word64 Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Word64 -> Value Source #

ToJSON () Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: () -> Value Source #

ToJSON Text Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Text -> Value Source #

ToJSON UTCTime Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: UTCTime -> Value Source #

ToJSON DotNetTime Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

ToJSON Text Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Text -> Value Source #

ToJSON JSString Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

ToJSON IntSet Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: IntSet -> Value Source #

ToJSON ZonedTime Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: ZonedTime -> Value Source #

ToJSON Value Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Value -> Value Source #

ToJSON [Char] Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: [Char] -> Value Source #

ToJSON a => ToJSON [a] Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: [a] -> Value Source #

ToJSON a => ToJSON (Maybe a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Maybe a -> Value Source #

ToJSON (Ratio Integer) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Ratio Integer -> Value Source #

ToJSON a => ToJSON (Last a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Last a -> Value Source #

ToJSON a => ToJSON (First a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: First a -> Value Source #

ToJSON a => ToJSON (Dual a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Dual a -> Value Source #

ToJSON a => ToJSON (HashSet a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: HashSet a -> Value Source #

HasResolution a => ToJSON (Fixed a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Fixed a -> Value Source #

ToJSON a => ToJSON (IntMap a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: IntMap a -> Value Source #

ToJSON a => ToJSON (Set a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Set a -> Value Source #

(ToJSON a, ToJSON b) => ToJSON (Either a b) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: Either a b -> Value Source #

(ToJSON a, ToJSON b) => ToJSON (a, b) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c) => ToJSON (a, b, c) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b, c) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d) => ToJSON (a, b, c, d) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b, c, d) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e) => ToJSON (a, b, c, d, e) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b, c, d, e) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f) => ToJSON (a, b, c, d, e, f) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b, c, d, e, f) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g) => ToJSON (a, b, c, d, e, f, g) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b, c, d, e, f, g) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h) => ToJSON (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b, c, d, e, f, g, h) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i) => ToJSON (a, b, c, d, e, f, g, h, i) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b, c, d, e, f, g, h, i) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j) => ToJSON (a, b, c, d, e, f, g, h, i, j) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k) => ToJSON (a, b, c, d, e, f, g, h, i, j, k) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l, m) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m, ToJSON n) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m, ToJSON n, ToJSON o) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Value Source #

Generic JSON classes

class GFromJSON f where Source #

Minimal complete definition

gParseJSON

Methods

gParseJSON :: Options -> Value -> Parser (f a) Source #

Instances
GFromJSON (U1 :: * -> *) Source # 
Instance details

Defined in JavaScript.JSON.Types.Generic

Methods

gParseJSON :: Options -> Value -> Parser (U1 a) Source #

FromJSON a => GFromJSON (K1 i a :: * -> *) Source # 
Instance details

Defined in JavaScript.JSON.Types.Generic

Methods

gParseJSON :: Options -> Value -> Parser (K1 i a a0) Source #

(AllNullary (a :+: b) allNullary, ParseSum (a :+: b) allNullary) => GFromJSON (a :+: b) Source # 
Instance details

Defined in JavaScript.JSON.Types.Generic

Methods

gParseJSON :: Options -> Value -> Parser ((a :+: b) a0) Source #

(FromProduct a, FromProduct b, ProductSize a, ProductSize b) => GFromJSON (a :*: b) Source # 
Instance details

Defined in JavaScript.JSON.Types.Generic

Methods

gParseJSON :: Options -> Value -> Parser ((a :*: b) a0) Source #

ConsFromJSON a => GFromJSON (C1 c a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Generic

Methods

gParseJSON :: Options -> Value -> Parser (C1 c a a0) Source #

GFromJSON a => GFromJSON (M1 i c a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Generic

Methods

gParseJSON :: Options -> Value -> Parser (M1 i c a a0) Source #

class GToJSON f where Source #

Minimal complete definition

gToJSON

Methods

gToJSON :: Options -> f a -> Value Source #

Instances
GToJSON (U1 :: * -> *) Source # 
Instance details

Defined in JavaScript.JSON.Types.Generic

Methods

gToJSON :: Options -> U1 a -> Value Source #

ToJSON a => GToJSON (K1 i a :: * -> *) Source # 
Instance details

Defined in JavaScript.JSON.Types.Generic

Methods

gToJSON :: Options -> K1 i a a0 -> Value Source #

(AllNullary (a :+: b) allNullary, SumToJSON (a :+: b) allNullary) => GToJSON (a :+: b) Source # 
Instance details

Defined in JavaScript.JSON.Types.Generic

Methods

gToJSON :: Options -> (a :+: b) a0 -> Value Source #

(WriteProduct a, WriteProduct b, ProductSize a, ProductSize b) => GToJSON (a :*: b) Source # 
Instance details

Defined in JavaScript.JSON.Types.Generic

Methods

gToJSON :: Options -> (a :*: b) a0 -> Value Source #

ConsToJSON a => GToJSON (C1 c a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Generic

Methods

gToJSON :: Options -> C1 c a a0 -> Value Source #

GToJSON a => GToJSON (M1 i c a) Source # 
Instance details

Defined in JavaScript.JSON.Types.Generic

Methods

gToJSON :: Options -> M1 i c a a0 -> Value Source #

genericToJSON :: (Generic a, GToJSON (Rep a)) => Options -> a -> Value Source #

genericParseJSON :: (Generic a, GFromJSON (Rep a)) => Options -> Value -> Parser a Source #

Types

newtype DotNetTime #

A newtype wrapper for UTCTime that uses the same non-standard serialization format as Microsoft .NET, whose System.DateTime type is by default serialized to JSON as in the following example:

/Date(1302547608878)/

The number represents milliseconds since the Unix epoch.

Constructors

DotNetTime 

Fields

Instances
Eq DotNetTime 
Instance details

Defined in Data.Aeson.Types.Internal

Ord DotNetTime 
Instance details

Defined in Data.Aeson.Types.Internal

Read DotNetTime 
Instance details

Defined in Data.Aeson.Types.Internal

Show DotNetTime 
Instance details

Defined in Data.Aeson.Types.Internal

ToJSON DotNetTime 
Instance details

Defined in Data.Aeson.Types.ToJSON

FormatTime DotNetTime 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> DotNetTime -> String)

FromJSON DotNetTime Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

ToJSON DotNetTime Source # 
Instance details

Defined in JavaScript.JSON.Types.Instances

Inspecting Values

withObject :: String -> (Object -> Parser a) -> Value -> Parser a Source #

withObject expected f value applies f to the Object when value is an Object and fails using typeMismatch expected otherwise.

withArray :: String -> (JSArray -> Parser a) -> Value -> Parser a Source #

withArray expected f value applies f to the Array when value is an Array and fails using typeMismatch expected otherwise.

withDouble :: String -> (Double -> Parser a) -> Value -> Parser a Source #

withScientific expected f value applies f to the Double number when value is a Number. and fails using typeMismatch expected otherwise.

withBool :: String -> (Bool -> Parser a) -> Value -> Parser a Source #

withBool expected f value applies f to the Bool when value is a Bool and fails using typeMismatch expected otherwise.

Functions

fromJSON :: FromJSON a => Value -> Result a Source #

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

(.:) :: FromJSON a => Object -> JSString -> Parser a Source #

Retrieve the value associated with the given key of an Object. The result is empty if the key is not present or the value cannot be converted to the desired type.

This accessor is appropriate if the key and value must be present in an object for it to be valid. If the key and value are optional, use '(.:?)' instead.

(.:?) :: FromJSON a => Object -> JSString -> Parser (Maybe a) Source #

Retrieve the value associated with the given key of an Object. The result is Nothing if the key is not present, or empty if the value cannot be converted to the desired type.

This accessor is most useful if the key and value can be absent from an object without affecting its validity. If the key and value are mandatory, use '(.:)' instead.

(.!=) :: Parser (Maybe a) -> a -> Parser a Source #

Helper for use in combination with .:? to provide default values for optional JSON object fields.

This combinator is most useful if the key and value can be absent from an object without affecting its validity and we know a default value to assign in that case. If the key and value are mandatory, use '(.:)' instead.

Example usage:

 v1 <- o .:? "opt_field_with_dfl" .!= "default_val"
 v2 <- o .:  "mandatory_field"
 v3 <- o .:? "opt_field2"

(.=) :: ToJSON a => JSString -> a -> Pair Source #

Construct a Pair from a key and a value.

typeMismatch Source #

Arguments

:: String

The name of the type you are trying to parse.

-> Value

The actual value encountered.

-> Parser a 

Fail parsing due to a type mismatch, with a descriptive message.

Orphan instances

FromJSON Bool Source # 
Instance details

FromJSON Char Source # 
Instance details

FromJSON Double Source # 
Instance details

FromJSON Float Source # 
Instance details

FromJSON Int Source # 
Instance details

FromJSON Int8 Source # 
Instance details

Methods

parseJSON :: Value -> Parser Int8 Source #

FromJSON Int16 Source # 
Instance details

Methods

parseJSON :: Value -> Parser Int16 Source #

FromJSON Int32 Source # 
Instance details

Methods

parseJSON :: Value -> Parser Int32 Source #

FromJSON Int64 Source # 
Instance details

Methods

parseJSON :: Value -> Parser Int64 Source #

FromJSON Integer Source #

WARNING: Only parse Integers from trusted input since an attacker could easily fill up the memory of the target system by specifying a scientific number with a big exponent like 1e1000000000.

Instance details

FromJSON Word Source # 
Instance details

FromJSON Word8 Source # 
Instance details

Methods

parseJSON :: Value -> Parser Word8 Source #

FromJSON Word16 Source # 
Instance details

Methods

parseJSON :: Value -> Parser Word16 Source #

FromJSON Word32 Source # 
Instance details

Methods

parseJSON :: Value -> Parser Word32 Source #

FromJSON Word64 Source # 
Instance details

Methods

parseJSON :: Value -> Parser Word64 Source #

FromJSON () Source # 
Instance details

Methods

parseJSON :: Value -> Parser () Source #

FromJSON Text Source # 
Instance details

Methods

parseJSON :: Value -> Parser Text Source #

FromJSON UTCTime Source # 
Instance details

Methods

parseJSON :: Value -> Parser UTCTime Source #

FromJSON DotNetTime Source # 
Instance details

FromJSON Text Source # 
Instance details

Methods

parseJSON :: Value -> Parser Text Source #

FromJSON JSString Source # 
Instance details

FromJSON IntSet Source # 
Instance details

Methods

parseJSON :: Value -> Parser IntSet Source #

FromJSON ZonedTime Source # 
Instance details

Methods

parseJSON :: Value -> Parser ZonedTime Source #

FromJSON Value Source # 
Instance details

ToJSON Bool Source # 
Instance details

Methods

toJSON :: Bool -> Value Source #

ToJSON Char Source # 
Instance details

Methods

toJSON :: Char -> Value Source #

ToJSON Double Source # 
Instance details

Methods

toJSON :: Double -> Value Source #

ToJSON Float Source # 
Instance details

Methods

toJSON :: Float -> Value Source #

ToJSON Int Source # 
Instance details

Methods

toJSON :: Int -> Value Source #

ToJSON Int8 Source # 
Instance details

Methods

toJSON :: Int8 -> Value Source #

ToJSON Int16 Source # 
Instance details

Methods

toJSON :: Int16 -> Value Source #

ToJSON Int32 Source # 
Instance details

Methods

toJSON :: Int32 -> Value Source #

ToJSON Int64 Source # 
Instance details

Methods

toJSON :: Int64 -> Value Source #

ToJSON Integer Source # 
Instance details

Methods

toJSON :: Integer -> Value Source #

ToJSON Word Source # 
Instance details

Methods

toJSON :: Word -> Value Source #

ToJSON Word8 Source # 
Instance details

Methods

toJSON :: Word8 -> Value Source #

ToJSON Word16 Source # 
Instance details

Methods

toJSON :: Word16 -> Value Source #

ToJSON Word32 Source # 
Instance details

Methods

toJSON :: Word32 -> Value Source #

ToJSON Word64 Source # 
Instance details

Methods

toJSON :: Word64 -> Value Source #

ToJSON () Source # 
Instance details

Methods

toJSON :: () -> Value Source #

ToJSON Text Source # 
Instance details

Methods

toJSON :: Text -> Value Source #

ToJSON UTCTime Source # 
Instance details

Methods

toJSON :: UTCTime -> Value Source #

ToJSON DotNetTime Source # 
Instance details

ToJSON Text Source # 
Instance details

Methods

toJSON :: Text -> Value Source #

ToJSON JSString Source # 
Instance details

ToJSON IntSet Source # 
Instance details

Methods

toJSON :: IntSet -> Value Source #

ToJSON ZonedTime Source # 
Instance details

Methods

toJSON :: ZonedTime -> Value Source #

ToJSON Value Source # 
Instance details

Methods

toJSON :: Value -> Value Source #

FromJSON [Char] Source # 
Instance details

FromJSON a => FromJSON [a] Source # 
Instance details

Methods

parseJSON :: Value -> Parser [a] Source #

FromJSON a => FromJSON (Maybe a) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (Maybe a) Source #

FromJSON (Ratio Integer) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (Ratio Integer) Source #

FromJSON a => FromJSON (Last a) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (Last a) Source #

FromJSON a => FromJSON (First a) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (First a) Source #

FromJSON a => FromJSON (Dual a) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (Dual a) Source #

(Eq a, Hashable a, FromJSON a) => FromJSON (HashSet a) Source # 
Instance details

HasResolution a => FromJSON (Fixed a) Source #

WARNING: Only parse fixed-precision numbers from trusted input since an attacker could easily fill up the memory of the target system by specifying a scientific number with a big exponent like 1e1000000000.

Instance details

Methods

parseJSON :: Value -> Parser (Fixed a) Source #

FromJSON a => FromJSON (IntMap a) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (IntMap a) Source #

(Ord a, FromJSON a) => FromJSON (Set a) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (Set a) Source #

ToJSON [Char] Source # 
Instance details

Methods

toJSON :: [Char] -> Value Source #

ToJSON a => ToJSON [a] Source # 
Instance details

Methods

toJSON :: [a] -> Value Source #

ToJSON a => ToJSON (Maybe a) Source # 
Instance details

Methods

toJSON :: Maybe a -> Value Source #

ToJSON (Ratio Integer) Source # 
Instance details

Methods

toJSON :: Ratio Integer -> Value Source #

ToJSON a => ToJSON (Last a) Source # 
Instance details

Methods

toJSON :: Last a -> Value Source #

ToJSON a => ToJSON (First a) Source # 
Instance details

Methods

toJSON :: First a -> Value Source #

ToJSON a => ToJSON (Dual a) Source # 
Instance details

Methods

toJSON :: Dual a -> Value Source #

ToJSON a => ToJSON (HashSet a) Source # 
Instance details

Methods

toJSON :: HashSet a -> Value Source #

HasResolution a => ToJSON (Fixed a) Source # 
Instance details

Methods

toJSON :: Fixed a -> Value Source #

ToJSON a => ToJSON (IntMap a) Source # 
Instance details

Methods

toJSON :: IntMap a -> Value Source #

ToJSON a => ToJSON (Set a) Source # 
Instance details

Methods

toJSON :: Set a -> Value Source #

(FromJSON a, FromJSON b) => FromJSON (Either a b) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (Either a b) Source #

(FromJSON a, FromJSON b) => FromJSON (a, b) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b) Source #

(ToJSON a, ToJSON b) => ToJSON (Either a b) Source # 
Instance details

Methods

toJSON :: Either a b -> Value Source #

(ToJSON a, ToJSON b) => ToJSON (a, b) Source # 
Instance details

Methods

toJSON :: (a, b) -> Value Source #

(FromJSON a, FromJSON b, FromJSON c) => FromJSON (a, b, c) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b, c) Source #

(ToJSON a, ToJSON b, ToJSON c) => ToJSON (a, b, c) Source # 
Instance details

Methods

toJSON :: (a, b, c) -> Value Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d) => FromJSON (a, b, c, d) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b, c, d) Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d) => ToJSON (a, b, c, d) Source # 
Instance details

Methods

toJSON :: (a, b, c, d) -> Value Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e) => FromJSON (a, b, c, d, e) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b, c, d, e) Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e) => ToJSON (a, b, c, d, e) Source # 
Instance details

Methods

toJSON :: (a, b, c, d, e) -> Value Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f) => FromJSON (a, b, c, d, e, f) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f) Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f) => ToJSON (a, b, c, d, e, f) Source # 
Instance details

Methods

toJSON :: (a, b, c, d, e, f) -> Value Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g) => FromJSON (a, b, c, d, e, f, g) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g) Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g) => ToJSON (a, b, c, d, e, f, g) Source # 
Instance details

Methods

toJSON :: (a, b, c, d, e, f, g) -> Value Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h) => FromJSON (a, b, c, d, e, f, g, h) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h) Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h) => ToJSON (a, b, c, d, e, f, g, h) Source # 
Instance details

Methods

toJSON :: (a, b, c, d, e, f, g, h) -> Value Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i) => FromJSON (a, b, c, d, e, f, g, h, i) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i) Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i) => ToJSON (a, b, c, d, e, f, g, h, i) Source # 
Instance details

Methods

toJSON :: (a, b, c, d, e, f, g, h, i) -> Value Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j) => FromJSON (a, b, c, d, e, f, g, h, i, j) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i, j) Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j) => ToJSON (a, b, c, d, e, f, g, h, i, j) Source # 
Instance details

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j) -> Value Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k) => FromJSON (a, b, c, d, e, f, g, h, i, j, k) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i, j, k) Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k) => ToJSON (a, b, c, d, e, f, g, h, i, j, k) Source # 
Instance details

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k) -> Value Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k, FromJSON l) => FromJSON (a, b, c, d, e, f, g, h, i, j, k, l) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i, j, k, l) Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l) Source # 
Instance details

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l) -> Value Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k, FromJSON l, FromJSON m) => FromJSON (a, b, c, d, e, f, g, h, i, j, k, l, m) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i, j, k, l, m) Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l, m) Source # 
Instance details

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Value Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k, FromJSON l, FromJSON m, FromJSON n) => FromJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m, ToJSON n) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source # 
Instance details

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Value Source #

(FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k, FromJSON l, FromJSON m, FromJSON n, FromJSON o) => FromJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m, ToJSON n, ToJSON o) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source # 
Instance details

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Value Source #