| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | Haskell2010 | 
PlutusTx.IsData.TH
Synopsis
- unsafeFromDataClause ∷ [(ConstructorInfo, Int)] → Q Clause
- unstableMakeIsData ∷ Name → Q [Dec]
- makeIsDataIndexed ∷ Name → [(Name, Int)] → Q [Dec]
- makeIsDataAsList ∷ Name → Q [Dec]
- mkConstrCreateExpr ∷ Integer → [Name] → ExpQ
- mkUnsafeConstrMatchPattern ∷ AsDataProdType → Integer → [Name] → PatQ
- mkConstrPartsMatchPattern ∷ Integer → [Name] → PatQ
- mkUnsafeConstrPartsMatchPattern ∷ AsDataProdType → Integer → [Name] → PatQ
- data AsDataProdType
- fromDataClause ∷ [(ConstructorInfo, Int)] → Q Clause
Documentation
unsafeFromDataClause ∷ [(ConstructorInfo, Int)] → Q Clause Source #
unstableMakeIsData ∷ Name → Q [Dec] Source #
Generate a FromData and a ToData instance for a type.
This may not be stable in the face of constructor additions,
renamings, etc. Use makeIsDataIndexed if you need stability.
makeIsDataIndexed ∷ Name → [(Name, Int)] → Q [Dec] Source #
Generate a ToData, 'FromData and a UnsafeFromData instances for a type,
using an explicit mapping of constructor names to indices.
Use this for types where you need to keep the representation stable.
mkUnsafeConstrMatchPattern ∷ AsDataProdType → Integer → [Name] → PatQ Source #
data AsDataProdType Source #
If generating pattern synonyms for a product type declared with asData,
we can avoid the index match, as we know that the type only has one constructor.
Constructors
| IsAsDataProdType | |
| IsNotAsDataProdType | 
fromDataClause ∷ [(ConstructorInfo, Int)] → Q Clause Source #