| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Rel8.TH
Synopsis
- deriveRel8able :: Name -> Q [Dec]
- deriveRel8ables :: [Name] -> Q [Dec]
Documentation
deriveRel8able :: Name -> Q [Dec] Source #
Derive a Rel8able instance using TemplateHaskell.
Using TH can be signficantly faster than using Generics.
Currently, this doesn't support all of the features of the Generics deriving machinery.
You might have to enable UndecidableInstances for instances to compile.
>>>data Foo f = Foo>>>{ fooId :: Column f Word64>>>, fooName :: Column f Text>>>}>>>>>>deriveRel8able ''Foo
deriveRel8ables :: [Name] -> Q [Dec] Source #
Like deriveRel8able but for a list of datatypes.
This is helpful as all of the instances live in a single splice.
Each TH splice creates a new decleration group, so they cannot see instances later in the file.
By deriving the instances in the same splice, we can ensure that they see each other.
This is necessary when deriving cyclic instances, but also reduces the amount of splice sorting required.
There is also a small performance overhead to each TH splice.