Safe Haskell | None |
---|---|
Language | Haskell2010 |
- gtoJSONDefault :: (Representable a, GToJSON (Rep a)) => a -> Value
- gparseJSONDefault :: (Representable a, GFromJSON (Rep a)) => Value -> Parser a
- class (Representable a, GToJSON (Rep a)) => RepGToJSON a
- class (Representable a, GFromJSON (Rep a)) => RepGFromJSON a
- class GToJSON a where
- class GFromJSON a where
- gparseJSON :: Value -> Parser a
- class GSumFromJSON a
- class GSumToJSON a
- class GSumSize a
Documentation
You can use gtoJSONDefault
and gparseJSONDefault
as your generic
toJSON
and parseJSON
implementations for any Representable
type as follows:
instanceToJSON
MyType where toJSON =gtoJSONDefault
instanceFromJSON
MyType where parseJSON =gparseJSONDefault
gtoJSONDefault :: (Representable a, GToJSON (Rep a)) => a -> Value Source
gparseJSONDefault :: (Representable a, GFromJSON (Rep a)) => Value -> Parser a Source
class (Representable a, GToJSON (Rep a)) => RepGToJSON a Source
is simply a synonym for
RepGToJSON
(
with the convenient
kind Representable
a, GToJSON
(Rep
a))(* ->
Constraint
)
(Representable a, GToJSON (Rep a)) => RepGToJSON a Source |
class (Representable a, GFromJSON (Rep a)) => RepGFromJSON a Source
is simply a synonym for
RepGFromJSON
(
with the convenient
kind Representable
a, GFromJSON
(Rep
a))(* ->
Constraint
)
(Representable a, GFromJSON (Rep a)) => RepGFromJSON a Source |
Internals
GToJSON Z Source | |
GToJSON U Source | |
ToJSON a => GToJSON (Var a) Source | |
ToJSON a => GToJSON (Rec a) Source | |
(GSumToJSON a, GSumToJSON b, GSumSize * a, GSumSize * b, GToJSON a, GToJSON b) => GToJSON ((:+:) a b) Source | |
(GToJSON a, GToJSON b) => GToJSON ((:*:) a b) Source | |
GToJSON a => GToJSON (CEq k k c p q a) Source | |
GToJSON a => GToJSON (CEq k k c p p a) Source |
class GFromJSON a where Source
gparseJSON :: Value -> Parser a Source
GFromJSON Z Source | |
GFromJSON U Source | |
FromJSON a => GFromJSON (Var a) Source | |
FromJSON a => GFromJSON (Rec a) Source | |
(GSumFromJSON a, GSumFromJSON b, GSumSize * a, GSumSize * b, GFromJSON a, GFromJSON b) => GFromJSON ((:+:) a b) Source | |
(GFromJSON a, GFromJSON b) => GFromJSON ((:*:) a b) Source | |
GFromJSON (CEq k k c p q a) Source | |
GFromJSON a => GFromJSON (CEq k k c p p a) Source |
Even more internal
class GSumFromJSON a Source
gsumParseJSON
(GSumFromJSON a, GSumFromJSON b, GFromJSON a, GFromJSON b) => GSumFromJSON ((:+:) a b) Source | |
GSumFromJSON (CEq k k c p q a) Source | |
GFromJSON a => GSumFromJSON (CEq k k c p p a) Source |
class GSumToJSON a Source
gsumToJSON
(GSumToJSON a, GSumToJSON b, GToJSON a, GToJSON b) => GSumToJSON ((:+:) a b) Source | |
GToJSON a => GSumToJSON (CEq k k c p q a) Source | |
GToJSON a => GSumToJSON (CEq k k c p p a) Source |