plutus-tx-1.60.0.0: Libraries for Plutus Tx and its prelude
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusTx.Blueprint.TH

Synopsis

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.

-> ClauseQ

The clause for the schema function.

Make a clause for the schema function.

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) #