| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.SerDoc.TH
Synopsis
- deriveSerializable :: Name -> [Name] -> Name -> DecsQ
- deriveHasInfo :: Name -> [Name] -> Name -> DecsQ
- deriveSerDoc :: Name -> [Name] -> Name -> DecsQ
Documentation
deriveSerializable :: Name -> [Name] -> Name -> DecsQ Source #
Derive a Serializable instance for the given codec and type.
Currently only supports record types.
The generated instance will serialize record fields in the order
they are declared in the source code, without any additional separators,
padding, or envelope around or between them, making it compatible with
deriveHasInfo. (See also deriveSerDoc.)
deriveHasInfo :: Name -> [Name] -> Name -> DecsQ Source #
Derive a HasInfo instance for the given codec and type.
Currently only supports record types.
A matching Serializable instance must serialize record fields in the order
they are declared in the source code, without any additional separators,
padding, or envelope around or between them. If your serializer does not meet
these requirements, you must write a custom HasInfo instance instead.
deriveSerDoc :: Name -> [Name] -> Name -> DecsQ Source #
Derive both a HasInfo instance and a matching Serializable instance,
combining deriveHasInfo and deriveSerializable.