registry-aeson-0.3.0.0: Aeson encoders / decoders
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Registry.Aeson.TH.Encoder

Synopsis

Documentation

makeEncoder :: Name -> ExpQ Source #

Make an Encoder for a given data type Usage: $(makeEncoder ''MyDataType <: otherEncoders)

makeEncoderQualified :: Name -> ExpQ Source #

Make an Encoder for a given data type, where all types names are qualified with their module full name Usage: -- MyDataType is defined in X.Y.Z import X.Y.Z qualified $(makeEncoderQualified ''MyDataType <: otherEncoders)

makeEncoderQualifiedLast :: Name -> ExpQ Source #

Make an Encoder for a given data type, where all types names are qualified with their module name -- MyDataType is defined in X.Y.Z import X.Y.Z qualified as Z $(makeEncoderQualifiedLast ''MyDataType <: otherEncoders)

makeEncoderWith :: ThOptions -> Name -> ExpQ Source #

Make an Encoder for a given data type and pass options to specify how names must be qualified Usage: $(makeEncoderWith options ''MyDataType) <: otherEncoders

makeMatchClause :: ThOptions -> [Name] -> [Type] -> Con -> MatchQ Source #

Make the match clause for a constructor given - the list of all the encoder types - the constructor name - the constructor index in the list of all the constructors for the encoded data type T1 a0 a1 ... -> encodeConstructor ce o (FromConstructor names types cName fieldNames values)