aeson-deriving-0.1.0.0: data types for compositional, type-directed serialization

Safe HaskellNone
LanguageHaskell2010

Data.Aeson.Deriving.Internal.RecordSum

Synopsis

Documentation

newtype ParserMap a Source #

Constructors

ParserMap (HashMap String (Value -> Parser a)) 
Instances
Functor ParserMap Source # 
Instance details

Defined in Data.Aeson.Deriving.Internal.RecordSum

Methods

fmap :: (a -> b) -> ParserMap a -> ParserMap b #

(<$) :: a -> ParserMap b -> ParserMap a #

Semigroup (ParserMap a) Source # 
Instance details

Defined in Data.Aeson.Deriving.Internal.RecordSum

Methods

(<>) :: ParserMap a -> ParserMap a -> ParserMap a #

sconcat :: NonEmpty (ParserMap a) -> ParserMap a #

stimes :: Integral b => b -> ParserMap a -> ParserMap a #

Monoid (ParserMap a) Source # 
Instance details

Defined in Data.Aeson.Deriving.Internal.RecordSum

class GTagParserMap (repA :: Type -> Type) where Source #

Provides a map from the (Haskell) constructor names of the inner contained types, To parsers for the (Rep of the) outer data type that carries them.

Methods

gParserMap :: Proxy repA -> ParserMap (repA x) Source #

Instances
(GConstructorNames (Rep a), FromJSON a) => GTagParserMap (Rec0 a) Source #

We can create a ParserMap from any reference to a data type that has a FromJSON instance (and at least one available constructor).

Instance details

Defined in Data.Aeson.Deriving.Internal.RecordSum

Methods

gParserMap :: Proxy (Rec0 a) -> ParserMap (Rec0 a x) Source #

(GTagParserMap repA, GTagParserMap repB) => GTagParserMap (repA :+: repB) Source #

ParserMaps corresponding to different cases of a sum type are combined by merging.

Instance details

Defined in Data.Aeson.Deriving.Internal.RecordSum

Methods

gParserMap :: Proxy (repA :+: repB) -> ParserMap ((repA :+: repB) x) Source #

GTagParserMap repA => GTagParserMap (D1 meta repA) Source #

The ParserMap for the whole data type is now the one we get from under this D1 constructor.

Instance details

Defined in Data.Aeson.Deriving.Internal.RecordSum

Methods

gParserMap :: Proxy (D1 meta repA) -> ParserMap (D1 meta repA x) Source #

GTagParserMap repA => GTagParserMap (C1 meta repA) Source #

ParserMaps are extended to the canonical representation of a constructor. Because there is no instance for :*:, this constraint is only satisfied for types with a single constructor (with an S1 Directly under the C1 in the canonical rep).

Instance details

Defined in Data.Aeson.Deriving.Internal.RecordSum

Methods

gParserMap :: Proxy (C1 meta repA) -> ParserMap (C1 meta repA x) Source #

GTagParserMap repA => GTagParserMap (S1 meta repA) Source #

ParserMaps are trivially extended to the representation of fields under a constructor

Instance details

Defined in Data.Aeson.Deriving.Internal.RecordSum

Methods

gParserMap :: Proxy (S1 meta repA) -> ParserMap (S1 meta repA x) Source #

class GConstructorNames (repA :: Type -> Type) where Source #

Provides constructor names

Methods

gConstructorNames :: Proxy repA -> [String] Source #

Instances
(GConstructorNames x, GConstructorNames y) => GConstructorNames (x :+: y) Source # 
Instance details

Defined in Data.Aeson.Deriving.Internal.RecordSum

Methods

gConstructorNames :: Proxy (x :+: y) -> [String] Source #

GConstructorNames r => GConstructorNames (D1 datatypeMeta r) Source # 
Instance details

Defined in Data.Aeson.Deriving.Internal.RecordSum

Methods

gConstructorNames :: Proxy (D1 datatypeMeta r) -> [String] Source #

Constructor constructorMeta => GConstructorNames (C1 constructorMeta r) Source # 
Instance details

Defined in Data.Aeson.Deriving.Internal.RecordSum

Methods

gConstructorNames :: Proxy (C1 constructorMeta r) -> [String] Source #