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

PlutusTx.Lift

Synopsis

Documentation

safeLiftWith Source #

Arguments

∷ ∀ a e uni fun m. (Lift uni a, AsTypeError e (Term TyName Name uni fun ()) uni fun (Provenance ()), GEq uni, AsTypeErrorExt e uni (Provenance ()), AsFreeVariableError e, AsError e uni fun (Provenance ()), MonadError e m, MonadQuote m, Typecheckable uni fun, PrettyUni uni, Pretty fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) 
⇒ (CompilationOpts () → CompilationOpts ())

Modifier of PIR compilation options

→ (CompilationOpts Name fun (Provenance ()) → CompilationOpts Name fun (Provenance ()))

Modifier of UPLC compilation options

Version 
→ a 
→ m (Term TyName Name uni fun (), Term NamedDeBruijn uni fun ()) 

Get a Plutus Core term corresponding to the given value. Allows configuring PIR and UPLC optimization options.

safeLift ∷ ∀ a e uni fun m. (Lift uni a, AsTypeError e (Term TyName Name uni fun ()) uni fun (Provenance ()), GEq uni, AsTypeErrorExt e uni (Provenance ()), AsFreeVariableError e, AsError e uni fun (Provenance ()), MonadError e m, MonadQuote m, Typecheckable uni fun, PrettyUni uni, Pretty fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ Version → a → m (Term TyName Name uni fun (), Term NamedDeBruijn uni fun ()) Source #

Get a Plutus Core term corresponding to the given value, applying default PIR/UPLC optimizations.

safeLiftUnopt ∷ ∀ a e uni fun m. (Lift uni a, AsTypeError e (Term TyName Name uni fun ()) uni fun (Provenance ()), GEq uni, AsTypeErrorExt e uni (Provenance ()), AsFreeVariableError e, AsError e uni fun (Provenance ()), MonadError e m, MonadQuote m, Typecheckable uni fun, PrettyUni uni, Pretty fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ Version → a → m (Term TyName Name uni fun (), Term NamedDeBruijn uni fun ()) Source #

Like safeLift but does not apply PIR/UPLC optimizations. Use this option where lifting speed is more important than optimal code.

safeLiftProgram ∷ (Lift uni a, AsTypeError e (Term TyName Name uni fun ()) uni fun (Provenance ()), GEq uni, AsTypeErrorExt e uni (Provenance ()), AsFreeVariableError e, AsError e uni fun (Provenance ()), MonadError e m, MonadQuote m, Typecheckable uni fun, PrettyUni uni, Pretty fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ Version → a → m (Program TyName Name uni fun (), Program NamedDeBruijn uni fun ()) Source #

Get a Plutus Core program corresponding to the given value, applying default PIR/UPLC optimizations.

safeLiftProgramUnopt ∷ (Lift uni a, AsTypeError e (Term TyName Name uni fun ()) uni fun (Provenance ()), GEq uni, AsTypeErrorExt e uni (Provenance ()), AsFreeVariableError e, AsError e uni fun (Provenance ()), MonadError e m, MonadQuote m, Typecheckable uni fun, PrettyUni uni, Pretty fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ Version → a → m (Program TyName Name uni fun (), Program NamedDeBruijn uni fun ()) Source #

Like safeLiftProgram but does not apply PIR/UPLC optimizations. Use this option where lifting speed is more important than optimal code.

safeLiftCode ∷ (Lift uni a, AsTypeError e (Term TyName Name uni fun ()) uni fun (Provenance ()), GEq uni, AsTypeErrorExt e uni (Provenance ()), AsFreeVariableError e, AsError e uni fun (Provenance ()), MonadError e m, MonadQuote m, Typecheckable uni fun, 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 #

safeLiftCodeUnopt ∷ (Lift uni a, AsTypeError e (Term TyName Name uni fun ()) uni fun (Provenance ()), GEq uni, AsTypeErrorExt e uni (Provenance ()), AsFreeVariableError e, AsError e uni fun (Provenance ()), MonadError e m, MonadQuote m, Typecheckable uni fun, 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 #

Like safeLiftCode but does not apply PIR/UPLC optimizations. Use this option where lifting speed is more important than optimal code.

lift ∷ (Lift uni a, ThrowableBuiltins uni fun, Typecheckable uni fun, GEq uni, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ Version → a → (Term TyName Name uni fun (), Term NamedDeBruijn uni fun ()) Source #

Get a Plutus Core term corresponding to the given value, throwing any errors that occur as exceptions and ignoring fresh names. The default PIR/UPLC optimizations are applied.

liftUnopt ∷ (Lift uni a, ThrowableBuiltins uni fun, Typecheckable uni fun, GEq uni, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ Version → a → (Term TyName Name uni fun (), Term NamedDeBruijn uni fun ()) Source #

Like lift but does not apply PIR/UPLC optimizations. Use this option where lifting speed is more important than optimal code.

liftProgram ∷ (Lift uni a, ThrowableBuiltins uni fun, Typecheckable uni fun, GEq uni, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ Version → a → (Program TyName Name uni fun (), Program NamedDeBruijn uni fun ()) Source #

Get a Plutus Core program corresponding to the given value, throwing any errors that occur as exceptions and ignoring fresh names.

liftProgramUnopt ∷ (Lift uni a, ThrowableBuiltins uni fun, Typecheckable uni fun, GEq uni, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ Version → a → (Program TyName Name uni fun (), Program NamedDeBruijn uni fun ()) Source #

Like liftProgram but does not apply PIR/UPLC optimizations. Use this option where lifting speed is more important than optimal code.

liftProgramDefLift DefaultUni a ⇒ a → (Program TyName Name DefaultUni DefaultFun (), Program NamedDeBruijn DefaultUni DefaultFun ()) Source #

Get a Plutus Core program in the default universe with the default version, corresponding to the given value, throwing any errors that occur as exceptions and ignoring fresh names.

liftProgramDefUnoptLift DefaultUni a ⇒ a → (Program TyName Name DefaultUni DefaultFun (), Program NamedDeBruijn DefaultUni DefaultFun ()) Source #

Like liftProgramDef but does not apply PIR/UPLC optimizations. Use this option where lifting speed is more important than optimal code.

liftCode ∷ (Lift uni a, GEq uni, ThrowableBuiltins uni fun, Typecheckable uni fun, 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.

liftCodeUnopt ∷ (Lift uni a, GEq uni, ThrowableBuiltins uni fun, Typecheckable uni fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ Version → a → CompiledCodeIn uni fun a Source #

Like liftCode but does not apply PIR/UPLC optimizations. Use this option where lifting speed is more important than optimal code.

liftCodeDef ∷ (Lift uni a, GEq uni, ThrowableBuiltins uni fun, Typecheckable uni fun, 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.

liftCodeDefUnopt ∷ (Lift uni a, GEq uni, ThrowableBuiltins uni fun, Typecheckable uni fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ a → CompiledCodeIn uni fun a Source #

Like liftCodeDef but does not apply PIR/UPLC optimizations. Use this option where lifting speed is more important than optimal code.

typeCheckAgainst ∷ ∀ e a uni fun m. (Typeable uni a, AsTypeError e (Term TyName Name uni fun ()) uni fun (Provenance ()), AsTypeErrorExt e uni (Provenance ()), AsError e uni fun (Provenance ()), MonadError e m, MonadQuote m, GEq uni, Typecheckable uni fun, PrettyUni uni, Pretty fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun)) ⇒ Proxy a → Program TyName Name uni fun () → m () Source #

Check that PLC term has the given type.

typeCode ∷ ∀ e a uni fun m. (Typeable uni a, AsTypeError e (Term TyName Name uni fun ()) uni fun (Provenance ()), AsTypeErrorExt e uni (Provenance ()), AsFreeVariableError e, AsError e uni fun (Provenance ()), MonadError e m, MonadQuote m, GEq uni, Typecheckable uni fun, PrettyUni uni, Pretty fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ Proxy a → Program TyName Name uni fun () → m (CompiledCodeIn uni fun a) Source #

Try to interpret a PLC program as a CompiledCodeIn of the given type. Returns successfully iff the program has the right type.