| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusTx.Blueprint.TH
Synopsis
- makeIsDataSchemaIndexed :: ConstructorInfo, SchemaInfo, Natural)] -> ClauseQ
- deriveParameterBlueprint :: Name -> Set Purpose -> ExpQ
- deriveArgumentBlueprint :: Name -> Set Purpose -> ExpQ
- lookupAnn :: Data a => Name -> Q [a]
- lookupSchemaTitle :: Name -> Q (Maybe SchemaTitle)
- lookupSchemaDescription :: Name -> Q (Maybe SchemaDescription)
Documentation
makeIsDataSchemaIndexed :: Name -> [(Name, Natural)] -> Q [InstanceDec] #
Generate a ToData, FromData, UnsafeFromData, HasBlueprintSchema 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.
Note: Requires ViewPatterns, FlexibleInstances, UndecidableInstances, MultiParamTypeClasses, TypeApplications language extensions and an `import PlutusTx.Blueprint.Definition (definitionRef)`.
unstableMakeIsDataSchema :: Name -> Q [Dec] #
Generate a ToData, FromData, UnsafeFromData, HasBlueprintSchema instances for a type,
using an implicit mapping of constructor names to indices [0..]
As the name suggests the representation can become unstable when constructors are added/removed.
Note: Requires ViewPatterns, FlexibleInstances, UndecidableInstances, MultiParamTypeClasses, TypeApplications language extensions and an `import PlutusTx.Blueprint.Definition (definitionRef)`.
makeHasSchemaInstance :: ConstructorInfo, SchemaInfo, Natural)]
The constructors of the type with their schema infos and indices.
The clause for the schema function.
Make a clause for the schema function.
lookupSchemaTitle :: Name -> Q (Maybe SchemaTitle) #
lookupSchemaDescription :: Name -> Q (Maybe SchemaDescription) #