Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype ParserMap a = ParserMap (HashMap String (Value -> Parser a))
- unsafeMapKeys :: (String -> String) -> ParserMap a -> ParserMap a
- class GTagParserMap (repA :: Type -> Type) where
- gParserMap :: Proxy repA -> ParserMap (repA x)
- class GConstructorNames (repA :: Type -> Type) where
- gConstructorNames :: Proxy repA -> [String]
Documentation
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.
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). |
Defined in Data.Aeson.Deriving.Internal.RecordSum | |
(GTagParserMap repA, GTagParserMap repB) => GTagParserMap (repA :+: repB) Source # | ParserMaps corresponding to different cases of a sum type are combined by merging. |
Defined in Data.Aeson.Deriving.Internal.RecordSum | |
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. |
Defined in Data.Aeson.Deriving.Internal.RecordSum | |
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). |
Defined in Data.Aeson.Deriving.Internal.RecordSum | |
GTagParserMap repA => GTagParserMap (S1 meta repA) Source # | ParserMaps are trivially extended to the representation of fields under a constructor |
Defined in Data.Aeson.Deriving.Internal.RecordSum |
class GConstructorNames (repA :: Type -> Type) where Source #
Provides constructor names
gConstructorNames :: Proxy repA -> [String] Source #
Instances
(GConstructorNames x, GConstructorNames y) => GConstructorNames (x :+: y) Source # | |
Defined in Data.Aeson.Deriving.Internal.RecordSum | |
GConstructorNames r => GConstructorNames (D1 datatypeMeta r) Source # | |
Defined in Data.Aeson.Deriving.Internal.RecordSum | |
Constructor constructorMeta => GConstructorNames (C1 constructorMeta r) Source # | |
Defined in Data.Aeson.Deriving.Internal.RecordSum |