instant-aeson-0.2: Generic Aeson instances through instant-generics

Safe HaskellNone
LanguageHaskell2010

Generics.Instant.Functions.Aeson

Contents

Synopsis

Documentation

You can use gtoJSONDefault and gparseJSONDefault as your generic toJSON and parseJSON implementations for any Representable type as follows:

instance ToJSON MyType where toJSON = gtoJSONDefault
instance FromJSON MyType where parseJSON = gparseJSONDefault

class (Representable a, GToJSON (Rep a)) => RepGToJSON a Source

RepGToJSON is simply a synonym for (Representable a, GToJSON (Rep a)) with the convenient kind (* -> Constraint)

Instances

class (Representable a, GFromJSON (Rep a)) => RepGFromJSON a Source

RepGFromJSON is simply a synonym for (Representable a, GFromJSON (Rep a)) with the convenient kind (* -> Constraint)

Instances

Internals

class GToJSON a where Source

Methods

gtoJSON :: a -> Value Source

Instances

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 

Even more internal

class GSumFromJSON a Source

Minimal complete definition

gsumParseJSON

Instances

class GSumToJSON a Source

Minimal complete definition

gsumToJSON

Instances

(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 

class GSumSize a Source

Minimal complete definition

sumSize

Instances

(GSumSize * a, GSumSize * b) => GSumSize * ((:+:) a b) Source 
GSumSize * (CEq k k c p q a) Source