| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
PlutusTx
Synopsis
- module PlutusTx.TH
- type CompiledCode = CompiledCodeIn DefaultUni DefaultFun
- data CompiledCodeIn (uni :: Type -> Type) fun a
- getPlc :: forall (uni :: Type -> Type) fun a. (Closed uni, Everywhere uni Flat, Flat fun) => CompiledCodeIn uni fun a -> Program NamedDeBruijn uni fun SrcSpans
- getPlcNoAnn :: forall (uni :: Type -> Type) fun a. (Closed uni, Everywhere uni Flat, Flat fun) => CompiledCodeIn uni fun a -> Program NamedDeBruijn uni fun ()
- getPir :: forall (uni :: Type -> Type) fun a. (Closed uni, Everywhere uni Flat, Flat fun) => CompiledCodeIn uni fun a -> Maybe (Program TyName Name uni fun SrcSpans)
- getPirNoAnn :: forall (uni :: Type -> Type) fun a. (Closed uni, Everywhere uni Flat, Flat fun) => CompiledCodeIn uni fun a -> Maybe (Program TyName Name uni fun ())
- applyCode :: forall (uni :: Type -> Type) fun a b. (Closed uni, Everywhere uni Flat, Flat fun, Pretty fun, Everywhere uni PrettyConst, PrettyBy RenderContext (SomeTypeIn uni)) => CompiledCodeIn uni fun (a -> b) -> CompiledCodeIn uni fun a -> Either String (CompiledCodeIn uni fun b)
- unsafeApplyCode :: forall (uni :: Type -> Type) fun a b. (Closed uni, Everywhere uni Flat, Flat fun, Pretty fun, Everywhere uni PrettyConst, PrettyBy RenderContext (SomeTypeIn uni)) => CompiledCodeIn uni fun (a -> b) -> CompiledCodeIn uni fun a -> CompiledCodeIn uni fun b
- data BuiltinData
- data Data
- class ToData a where
- toBuiltinData :: a -> BuiltinData
- class FromData a where
- fromBuiltinData :: BuiltinData -> Maybe a
- class UnsafeFromData a where
- unsafeFromBuiltinData :: BuiltinData -> a
- toData :: ToData a => a -> Data
- fromData :: FromData a => Data -> Maybe a
- builtinDataToData :: BuiltinData -> Data
- dataToBuiltinData :: Data -> BuiltinData
- unstableMakeIsData :: Name -> Q [Dec]
- makeIsDataIndexed :: Name -> [(Name, Int)] -> Q [Dec]
- makeIsDataSchemaIndexed :: Name -> [(Name, Natural)] -> Q [InstanceDec]
- class Lift (uni :: Type -> Type) a
- class Typeable (uni :: Type -> Type) (a :: k)
- makeLift :: Name -> Q [Dec]
- safeLiftCode :: forall (uni :: Type -> Type) a fun m. (Lift uni a, GEq uni, Everywhere uni Eq, MonadError (Error uni fun (Provenance ())) m, MonadQuote m, Typecheckable uni fun, CaseBuiltin uni, PrettyUni uni, Pretty fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) => Version -> a -> m (CompiledCodeIn uni fun a)
- liftCode :: forall (uni :: Type -> Type) a fun. (Lift uni a, GEq uni, Everywhere uni Eq, ThrowableBuiltins uni fun, Typecheckable uni fun, CaseBuiltin uni, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) => Version -> a -> CompiledCodeIn uni fun a
- liftCodeDef :: forall (uni :: Type -> Type) a fun. (Lift uni a, GEq uni, Everywhere uni Eq, ThrowableBuiltins uni fun, Typecheckable uni fun, CaseBuiltin uni, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) => a -> CompiledCodeIn uni fun a
Documentation
module PlutusTx.TH
type CompiledCode = CompiledCodeIn DefaultUni DefaultFun Source #
CompiledCodeIn instantiated with default built-in types and functions.
data CompiledCodeIn (uni :: Type -> Type) fun a Source #
A compiled Plutus Tx program. The last type parameter indicates the type of the Haskell expression that was compiled, and hence the type of the compiled code.
Note: the compiled PLC program does *not* have normalized types, if you want to put it on the chain you must normalize the types first.
getPlc :: forall (uni :: Type -> Type) fun a. (Closed uni, Everywhere uni Flat, Flat fun) => CompiledCodeIn uni fun a -> Program NamedDeBruijn uni fun SrcSpans Source #
Get the actual Plutus Core program out of a CompiledCodeIn.
getPlcNoAnn :: forall (uni :: Type -> Type) fun a. (Closed uni, Everywhere uni Flat, Flat fun) => CompiledCodeIn uni fun a -> Program NamedDeBruijn uni fun () Source #
getPir :: forall (uni :: Type -> Type) fun a. (Closed uni, Everywhere uni Flat, Flat fun) => CompiledCodeIn uni fun a -> Maybe (Program TyName Name uni fun SrcSpans) Source #
Get the Plutus IR program, if there is one, out of a CompiledCodeIn.
getPirNoAnn :: forall (uni :: Type -> Type) fun a. (Closed uni, Everywhere uni Flat, Flat fun) => CompiledCodeIn uni fun a -> Maybe (Program TyName Name uni fun ()) Source #
applyCode :: forall (uni :: Type -> Type) fun a b. (Closed uni, Everywhere uni Flat, Flat fun, Pretty fun, Everywhere uni PrettyConst, PrettyBy RenderContext (SomeTypeIn uni)) => CompiledCodeIn uni fun (a -> b) -> CompiledCodeIn uni fun a -> Either String (CompiledCodeIn uni fun b) Source #
Apply a compiled function to a compiled argument. Will fail if the versions don't match.
unsafeApplyCode :: forall (uni :: Type -> Type) fun a b. (Closed uni, Everywhere uni Flat, Flat fun, Pretty fun, Everywhere uni PrettyConst, PrettyBy RenderContext (SomeTypeIn uni)) => CompiledCodeIn uni fun (a -> b) -> CompiledCodeIn uni fun a -> CompiledCodeIn uni fun b Source #
Apply a compiled function to a compiled argument. Will throw if the versions don't match, should only be used in non-production code.
data BuiltinData Source #
A type corresponding to the Plutus Core builtin equivalent of Data.
The point of this type is to be an opaque equivalent of Data, so as to
ensure that it is only used in ways that the compiler can handle.
As such, you should use this type in your on-chain code, and in any data structures that you want to be representable on-chain.
For off-chain usage, there are conversion functions builtinDataToData and
dataToBuiltinData, but note that these will not work on-chain.
Instances
Instances
| Data Data | |||||||||||||
Defined in PlutusCore.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Data -> c Data Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Data Source # toConstr :: Data -> Constr Source # dataTypeOf :: Data -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Data) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Data) Source # gmapT :: (forall b. Data b => b -> b) -> Data -> Data Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Data -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Data -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Data -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Data -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Data -> m Data Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Data -> m Data Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Data -> m Data Source # | |||||||||||||
| Generic Data | |||||||||||||
Defined in PlutusCore.Data Associated Types
| |||||||||||||
| Read Data | |||||||||||||
| Show Data | |||||||||||||
| NFData Data | |||||||||||||
Defined in PlutusCore.Data | |||||||||||||
| Eq Data | |||||||||||||
| Ord Data | |||||||||||||
| Hashable Data | |||||||||||||
Defined in PlutusCore.Data | |||||||||||||
| NoThunks Data | |||||||||||||
| ExMemoryUsage Data | |||||||||||||
Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage Methods memoryUsage :: Data -> CostRose | |||||||||||||
| HasToBuiltin Data Source # | |||||||||||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
| |||||||||||||
| Pretty Data | |||||||||||||
Defined in PlutusCore.Data | |||||||||||||
| Serialise Data | |||||||||||||
Defined in PlutusCore.Data | |||||||||||||
| PrettyBy ConstConfig Data | |||||||||||||
Defined in PlutusCore.Pretty.PrettyConst | |||||||||||||
| KnownBuiltinTypeIn DefaultUni term Data => MakeKnownIn DefaultUni term Data | |||||||||||||
Defined in PlutusCore.Default.Universe | |||||||||||||
| KnownBuiltinTypeIn DefaultUni term Data => ReadKnownIn DefaultUni term Data | |||||||||||||
Defined in PlutusCore.Default.Universe | |||||||||||||
| Contains DefaultUni Data | |||||||||||||
Defined in PlutusCore.Default.Universe | |||||||||||||
| KnownBuiltinTypeAst tyname DefaultUni Data => KnownTypeAst tyname DefaultUni Data | |||||||||||||
Defined in PlutusCore.Default.Universe Associated Types
Methods typeAst :: Type tyname DefaultUni () | |||||||||||||
| type Rep Data | |||||||||||||
Defined in PlutusCore.Data type Rep Data = D1 ('MetaData "Data" "PlutusCore.Data" "plutus-core-1.60.0.0-LXFqBsoUlXsJIEqLytHte7" 'False) ((C1 ('MetaCons "Constr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Data])) :+: C1 ('MetaCons "Map" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Data, Data)]))) :+: (C1 ('MetaCons "List" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Data])) :+: (C1 ('MetaCons "I" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)) :+: C1 ('MetaCons "B" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))))) | |||||||||||||
| type ToBuiltin Data Source # | |||||||||||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||||||||||
| type IsBuiltin DefaultUni Data | |||||||||||||
Defined in PlutusCore.Default.Universe | |||||||||||||
| type ToBinds DefaultUni acc Data | |||||||||||||
Defined in PlutusCore.Default.Universe | |||||||||||||
| type ToHoles DefaultUni hole Data | |||||||||||||
Defined in PlutusCore.Default.Universe | |||||||||||||
A typeclass for types that can be converted to and from BuiltinData.
Instances
| ToData Void Source # | |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: Void -> BuiltinData Source # | |
| ToData BuiltinBLS12_381_G1_Element Source # | For the BLS12-381 G1 and G2 types we use the |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: BuiltinBLS12_381_G1_Element -> BuiltinData Source # | |
| ToData BuiltinBLS12_381_G2_Element Source # | |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: BuiltinBLS12_381_G2_Element -> BuiltinData Source # | |
| (TypeError ('Text "toBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => ToData BuiltinBLS12_381_MlResult Source # | We do not provide instances of any of these classes for BuiltinBLS12_381_MlResult since there is no serialisation format: we expect that values of that type will only occur as the result of on-chain computations. |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: BuiltinBLS12_381_MlResult -> BuiltinData Source # | |
| ToData BuiltinByteString Source # | |
Defined in PlutusTx.IsData.Class Methods | |
| ToData BuiltinData Source # | |
Defined in PlutusTx.IsData.Class Methods | |
| ToData Rational Source # | |
Defined in PlutusTx.Ratio Methods toBuiltinData :: Rational -> BuiltinData Source # | |
| ToData Sqrt Source # | |
Defined in PlutusTx.Sqrt Methods toBuiltinData :: Sqrt -> BuiltinData Source # | |
| ToData Integer Source # | |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: Integer -> BuiltinData Source # | |
| ToData () Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: () -> BuiltinData Source # | |
| ToData Bool Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: Bool -> BuiltinData Source # | |
| (TypeError ('Text "Int is not supported, use Integer instead") :: Constraint) => ToData Int Source # | |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: Int -> BuiltinData Source # | |
| ToData (List a) Source # | |
Defined in PlutusTx.Data.List Methods toBuiltinData :: List a -> BuiltinData Source # | |
| ToData a => ToData (Maybe a) Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: Maybe a -> BuiltinData Source # | |
| ToData a => ToData [a] Source # | |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: [a] -> BuiltinData Source # | |
| (ToData a, ToData b) => ToData (Either a b) Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: Either a b -> BuiltinData Source # | |
| (ToData k, ToData v) => ToData (Map k v) Source # | Hand-written instances to use the underlying |
Defined in PlutusTx.AssocMap Methods toBuiltinData :: Map k v -> BuiltinData Source # | |
| ToData (Map k a) Source # | |
Defined in PlutusTx.Data.AssocMap Methods toBuiltinData :: Map k a -> BuiltinData Source # | |
| (ToData a, ToData b) => ToData (These a b) Source # | |
Defined in PlutusTx.These Methods toBuiltinData :: These a b -> BuiltinData Source # | |
| (ToData a, ToData b) => ToData (a, b) Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: (a, b) -> BuiltinData Source # | |
| (ToData a, ToData b, ToData c) => ToData (a, b, c) Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: (a, b, c) -> BuiltinData Source # | |
| (ToData a, ToData b, ToData c, ToData d) => ToData (a, b, c, d) Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: (a, b, c, d) -> BuiltinData Source # | |
class FromData a where Source #
Methods
fromBuiltinData :: BuiltinData -> Maybe a Source #
Convert a value from BuiltinData, returning Nothing if this fails.
Instances
| FromData Void Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe Void Source # | |
| FromData BuiltinBLS12_381_G1_Element Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinBLS12_381_G1_Element Source # | |
| FromData BuiltinBLS12_381_G2_Element Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinBLS12_381_G2_Element Source # | |
| (TypeError ('Text "fromBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => FromData BuiltinBLS12_381_MlResult Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinBLS12_381_MlResult Source # | |
| FromData BuiltinByteString Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinByteString Source # | |
| FromData BuiltinData Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinData Source # | |
| FromData Rational Source # | |
Defined in PlutusTx.Ratio Methods | |
| FromData Sqrt Source # | |
Defined in PlutusTx.Sqrt Methods fromBuiltinData :: BuiltinData -> Maybe Sqrt Source # | |
| FromData Integer Source # | |
Defined in PlutusTx.IsData.Class Methods | |
| FromData () Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe () Source # | |
| FromData Bool Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe Bool Source # | |
| (TypeError ('Text "Int is not supported, use Integer instead") :: Constraint) => FromData Int Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe Int Source # | |
| FromData (List a) Source # | |
Defined in PlutusTx.Data.List Methods fromBuiltinData :: BuiltinData -> Maybe (List a) Source # | |
| FromData a => FromData (Maybe a) Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe (Maybe a) Source # | |
| FromData a => FromData [a] Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe [a] Source # | |
| (FromData a, FromData b) => FromData (Either a b) Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe (Either a b) Source # | |
| (FromData k, FromData v) => FromData (Map k v) Source # | A hand-written transformation from |
Defined in PlutusTx.AssocMap Methods fromBuiltinData :: BuiltinData -> Maybe (Map k v) Source # | |
| FromData (Map k a) Source # | |
Defined in PlutusTx.Data.AssocMap Methods fromBuiltinData :: BuiltinData -> Maybe (Map k a) Source # | |
| (FromData a, FromData b) => FromData (These a b) Source # | |
Defined in PlutusTx.These Methods fromBuiltinData :: BuiltinData -> Maybe (These a b) Source # | |
| (FromData a, FromData b) => FromData (a, b) Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe (a, b) Source # | |
| (FromData a, FromData b, FromData c) => FromData (a, b, c) Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe (a, b, c) Source # | |
| (FromData a, FromData b, FromData c, FromData d) => FromData (a, b, c, d) Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe (a, b, c, d) Source # | |
class UnsafeFromData a where Source #
Methods
unsafeFromBuiltinData :: BuiltinData -> a Source #
Convert a value from BuiltinData, calling error if this fails.
This is typically much faster than fromBuiltinData.
When implementing this function, make sure to call unsafeFromBuiltinData
rather than fromBuiltinData when converting substructures!
This is a simple type without any validation, use with caution.
Instances
| UnsafeFromData Void Source # | |
Defined in PlutusTx.IsData.Class Methods | |
| UnsafeFromData BuiltinBLS12_381_G1_Element Source # | |
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinBLS12_381_G1_Element Source # | |
| UnsafeFromData BuiltinBLS12_381_G2_Element Source # | |
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinBLS12_381_G2_Element Source # | |
| (TypeError ('Text "unsafeFromBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => UnsafeFromData BuiltinBLS12_381_MlResult Source # | |
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinBLS12_381_MlResult Source # | |
| UnsafeFromData BuiltinByteString Source # | |
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinByteString Source # | |
| UnsafeFromData BuiltinData Source # | |
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinData Source # | |
| UnsafeFromData Rational Source # | |
Defined in PlutusTx.Ratio Methods | |
| UnsafeFromData Sqrt Source # | |
Defined in PlutusTx.Sqrt Methods | |
| UnsafeFromData Integer Source # | |
Defined in PlutusTx.IsData.Class Methods | |
| UnsafeFromData () Source # | |
Defined in PlutusTx.IsData.Instances Methods unsafeFromBuiltinData :: BuiltinData -> () Source # | |
| UnsafeFromData Bool Source # | |
Defined in PlutusTx.IsData.Instances Methods | |
| (TypeError ('Text "Int is not supported, use Integer instead") :: Constraint) => UnsafeFromData Int Source # | |
Defined in PlutusTx.IsData.Class Methods | |
| UnsafeFromData (List a) Source # | |
Defined in PlutusTx.Data.List Methods unsafeFromBuiltinData :: BuiltinData -> List a Source # | |
| UnsafeFromData a => UnsafeFromData (Maybe a) Source # | |
Defined in PlutusTx.IsData.Instances Methods unsafeFromBuiltinData :: BuiltinData -> Maybe a Source # | |
| UnsafeFromData a => UnsafeFromData [a] Source # | |
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> [a] Source # | |
| (UnsafeFromData a, UnsafeFromData b) => UnsafeFromData (Either a b) Source # | |
Defined in PlutusTx.IsData.Instances Methods unsafeFromBuiltinData :: BuiltinData -> Either a b Source # | |
| (UnsafeFromData k, UnsafeFromData v) => UnsafeFromData (Map k v) Source # | A hand-written transformation from |
Defined in PlutusTx.AssocMap Methods unsafeFromBuiltinData :: BuiltinData -> Map k v Source # | |
| UnsafeFromData (Map k a) Source # | |
Defined in PlutusTx.Data.AssocMap Methods unsafeFromBuiltinData :: BuiltinData -> Map k a Source # | |
| (UnsafeFromData a, UnsafeFromData b) => UnsafeFromData (These a b) Source # | |
Defined in PlutusTx.These Methods unsafeFromBuiltinData :: BuiltinData -> These a b Source # | |
| (UnsafeFromData a, UnsafeFromData b) => UnsafeFromData (a, b) Source # | |
Defined in PlutusTx.IsData.Instances Methods unsafeFromBuiltinData :: BuiltinData -> (a, b) Source # | |
| (UnsafeFromData a, UnsafeFromData b, UnsafeFromData c) => UnsafeFromData (a, b, c) Source # | |
Defined in PlutusTx.IsData.Instances Methods unsafeFromBuiltinData :: BuiltinData -> (a, b, c) Source # | |
| (UnsafeFromData a, UnsafeFromData b, UnsafeFromData c, UnsafeFromData d) => UnsafeFromData (a, b, c, d) Source # | |
Defined in PlutusTx.IsData.Instances Methods unsafeFromBuiltinData :: BuiltinData -> (a, b, c, d) Source # | |
builtinDataToData :: BuiltinData -> Data Source #
NOT a builtin. Converts a BuiltinData into a Data. Only works off-chain.
dataToBuiltinData :: Data -> BuiltinData Source #
NOT a builtin. Converts a Data into a BuiltinData. Only works off-chain.
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.
makeIsDataSchemaIndexed :: Name -> [(Name, Natural)] -> Q [InstanceDec] Source #
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)`.
class Lift (uni :: Type -> Type) a Source #
Class for types which can be lifted into Plutus IR. Instances should be derived, do not write your own instance!
Minimal complete definition
Instances
| Lift DefaultUni Rational Source # | |
| Lift DefaultUni Sqrt Source # | |
| Lift DefaultUni () Source # | |
Defined in PlutusTx.Lift.Instances | |
| HasTermLevel uni Element => Lift uni BuiltinBLS12_381_G1_Element Source # | |
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinBLS12_381_G1_Element -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |
| HasTermLevel uni Element => Lift uni BuiltinBLS12_381_G2_Element Source # | |
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinBLS12_381_G2_Element -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |
| HasTermLevel uni MlResult => Lift uni BuiltinBLS12_381_MlResult Source # | |
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinBLS12_381_MlResult -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |
| HasTermLevel uni ByteString => Lift uni BuiltinByteString Source # | |
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinByteString -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |
| HasTermLevel uni Data => Lift uni BuiltinData Source # | |
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinData -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |
| HasTermLevel uni Integer => Lift uni BuiltinInteger Source # | |
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinInteger -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |
| HasTermLevel uni Text => Lift uni BuiltinString Source # | |
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinString -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |
| HasTermLevel uni () => Lift uni BuiltinUnit Source # | |
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinUnit -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |
| HasTermLevel uni Value => Lift uni BuiltinValue Source # | |
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinValue -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |
| HasTermLevel uni Bool => Lift uni Bool Source # | |
| (TypeError ('Text "Int is not supported, use Integer instead") :: Constraint) => Lift uni Int Source # | |
| Lift DefaultUni (List a) Source # | |
| (Typeable DefaultUni a, Lift DefaultUni a) => Lift DefaultUni (Maybe a) Source # | |
| (Typeable DefaultUni a, Lift DefaultUni a) => Lift DefaultUni [a] Source # | |
Defined in PlutusTx.Lift.Instances | |
| (HasFromBuiltin arep, HasTermLevel uni (Vector (FromBuiltin arep))) => Lift uni (BuiltinArray arep) Source # | |
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinArray arep -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |
| (HasFromBuiltin arep, HasTermLevel uni [FromBuiltin arep]) => Lift uni (BuiltinList arep) Source # | |
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinList arep -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |
| (Typeable DefaultUni a, Typeable DefaultUni b, Lift DefaultUni a, Lift DefaultUni b) => Lift DefaultUni (Either a b) Source # | |
| Lift DefaultUni [(k, v)] => Lift DefaultUni (Map k v) Source # | |
| Lift DefaultUni (Map k a) Source # | |
| (Typeable DefaultUni a, Typeable DefaultUni b, Lift DefaultUni a, Lift DefaultUni b) => Lift DefaultUni (These a b) Source # | |
| (Typeable DefaultUni a, Typeable DefaultUni b, Lift DefaultUni a, Lift DefaultUni b) => Lift DefaultUni (a, b) Source # | |
Defined in PlutusTx.Lift.Instances | |
| (HasFromBuiltin arep, HasFromBuiltin brep, HasTermLevel uni (FromBuiltin arep, FromBuiltin brep)) => Lift uni (BuiltinPair arep brep) Source # | |
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinPair arep brep -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |
| (Typeable DefaultUni a, Typeable DefaultUni b, Typeable DefaultUni c, Lift DefaultUni a, Lift DefaultUni b, Lift DefaultUni c) => Lift DefaultUni (a, b, c) Source # | |
Defined in PlutusTx.Lift.Instances | |
| (Typeable DefaultUni a, Typeable DefaultUni b, Typeable DefaultUni c, Typeable DefaultUni d, Lift DefaultUni a, Lift DefaultUni b, Lift DefaultUni c, Lift DefaultUni d) => Lift DefaultUni (a, b, c, d) Source # | |
Defined in PlutusTx.Lift.Instances | |
| (Typeable DefaultUni a, Typeable DefaultUni b, Typeable DefaultUni c, Typeable DefaultUni d, Typeable DefaultUni e, Lift DefaultUni a, Lift DefaultUni b, Lift DefaultUni c, Lift DefaultUni d, Lift DefaultUni e) => Lift DefaultUni (a, b, c, d, e) Source # | |
Defined in PlutusTx.Lift.Instances | |
class Typeable (uni :: Type -> Type) (a :: k) Source #
Class for types which have a corresponding Plutus IR type. Instances should always be derived, do not write your own instance!
Minimal complete definition
Instances
| Typeable DefaultUni Rational Source # | |
| Typeable DefaultUni Sqrt Source # | |
| Typeable DefaultUni () Source # | |
| HasTypeLevel uni Element => Typeable uni BuiltinBLS12_381_G1_Element Source # | |
Defined in PlutusTx.Lift.Class | |
| HasTypeLevel uni Element => Typeable uni BuiltinBLS12_381_G2_Element Source # | |
Defined in PlutusTx.Lift.Class | |
| HasTypeLevel uni MlResult => Typeable uni BuiltinBLS12_381_MlResult Source # | |
Defined in PlutusTx.Lift.Class | |
| HasTypeLevel uni ByteString => Typeable uni BuiltinByteString Source # | |
Defined in PlutusTx.Lift.Class | |
| HasTypeLevel uni Data => Typeable uni BuiltinData Source # | |
Defined in PlutusTx.Lift.Class | |
| HasTypeLevel uni Integer => Typeable uni BuiltinInteger Source # | |
Defined in PlutusTx.Lift.Class | |
| HasTypeLevel uni Text => Typeable uni BuiltinString Source # | |
Defined in PlutusTx.Lift.Class | |
| HasTypeLevel uni () => Typeable uni BuiltinUnit Source # | |
Defined in PlutusTx.Lift.Class | |
| HasTypeLevel uni Value => Typeable uni BuiltinValue Source # | |
Defined in PlutusTx.Lift.Class | |
| HasTypeLevel uni Bool => Typeable uni Bool Source # | |
| (TypeError ('Text "Int is not supported, use Integer instead") :: Constraint) => Typeable uni Int Source # | |
| (Typeable uni f, Typeable uni a) => Typeable uni (f a :: k) Source # | |
| Typeable DefaultUni (,,,,) Source # | |
| Typeable DefaultUni (,,,) Source # | |
| Typeable DefaultUni (,,) Source # | |
| Typeable DefaultUni Either Source # | |
| Typeable DefaultUni Map Source # | |
| Typeable DefaultUni Map Source # | |
| Typeable DefaultUni These Source # | |
| Typeable DefaultUni (,) Source # | |
| HasTypeLevel uni (,) => Typeable uni BuiltinPair Source # | |
Defined in PlutusTx.Lift.Class | |
| Typeable DefaultUni List Source # | |
| Typeable DefaultUni Maybe Source # | |
| Typeable DefaultUni [] Source # | |
| HasTypeLevel uni Vector => Typeable uni BuiltinArray Source # | |
Defined in PlutusTx.Lift.Class | |
| HasTypeLevel uni [] => Typeable uni BuiltinList Source # | |
Defined in PlutusTx.Lift.Class | |
| Typeable uni (->) Source # | |
safeLiftCode :: forall (uni :: Type -> Type) a fun m. (Lift uni a, GEq uni, Everywhere uni Eq, MonadError (Error uni fun (Provenance ())) m, MonadQuote m, Typecheckable uni fun, CaseBuiltin uni, PrettyUni uni, Pretty fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) => Version -> a -> m (CompiledCodeIn uni fun a) Source #
liftCode :: forall (uni :: Type -> Type) a fun. (Lift uni a, GEq uni, Everywhere uni Eq, ThrowableBuiltins uni fun, Typecheckable uni fun, CaseBuiltin uni, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) => Version -> a -> CompiledCodeIn uni fun a Source #
Get a Plutus Core program corresponding to the given value as a CompiledCodeIn, throwing any errors that occur as exceptions and ignoring fresh names.
liftCodeDef :: forall (uni :: Type -> Type) a fun. (Lift uni a, GEq uni, Everywhere uni Eq, ThrowableBuiltins uni fun, Typecheckable uni fun, CaseBuiltin uni, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) => a -> CompiledCodeIn uni fun a Source #
Get a Plutus Core program with the default version, corresponding to the given value as a CompiledCodeIn, throwing any errors that occur as exceptions and ignoring fresh names.