| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
TH.ReifyDataType
Description
Utilities for reifying simplified datatype info. It omits details that aren't usually relevant to generating instances that work with the datatype. This makes it easier to use TH to derive instances.
Documentation
Simplified info about a DataD. Omits deriving, strictness, and
kind info.
Simplified info about a Con. Omits strictness, and kind info.
This is much nicer than consuming Con directly, because it unifies
all the constructors into one.
Constructors
| DataCon | |
reifyDataType :: Name -> Q DataType Source
Reify the given data or newtype declaration, and yields its
DataType representation.
conToDataCons :: Con -> [DataCon] Source
reifyDataTypeSubstituted :: Type -> Q DataType Source
Like reifyDataType, but takes a Type instead of just the Name
of the datatype. It expects a normal datatype argument (see
typeToNamedCon).