plutus-tx-1.0.0.0: Libraries for Plutus Tx and its prelude
Safe HaskellNone
LanguageHaskell2010

PlutusTx.Lift

Synopsis
  • makeLift :: Name -> Q [Dec]
  • safeLift :: (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, PrettyPrintable uni fun) => a -> m (Term NamedDeBruijn uni fun ())
  • 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, PrettyPrintable uni fun) => a -> m (Program NamedDeBruijn uni fun ())
  • 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, PrettyPrintable uni fun) => a -> m (CompiledCodeIn uni fun a)
  • lift :: (Lift uni a, Throwable uni fun, Typecheckable uni fun) => a -> Term NamedDeBruijn uni fun ()
  • liftProgram :: (Lift uni a, Throwable uni fun, Typecheckable uni fun) => a -> Program NamedDeBruijn uni fun ()
  • liftProgramDef :: Lift DefaultUni a => a -> Program NamedDeBruijn DefaultUni DefaultFun ()
  • liftCode :: (Lift uni a, Throwable uni fun, Typecheckable uni fun) => a -> CompiledCodeIn uni fun a
  • typeCheckAgainst :: forall 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, PrettyPrintable uni fun) => Proxy a -> Term TyName Name uni fun () -> m ()
  • typeCode :: forall 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, PrettyPrintable uni fun) => Proxy a -> Program TyName Name uni fun () -> m (CompiledCodeIn uni fun a)

Documentation

safeLift :: (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, PrettyPrintable uni fun) => a -> m (Term NamedDeBruijn uni fun ()) Source #

Get a Plutus Core term corresponding to the given value.

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, PrettyPrintable uni fun) => a -> m (Program NamedDeBruijn uni fun ()) Source #

Get a Plutus Core program corresponding to the given value.

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, PrettyPrintable uni fun) => a -> m (CompiledCodeIn uni fun a) Source #

lift :: (Lift uni a, Throwable uni fun, Typecheckable uni fun) => a -> 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.

liftProgram :: (Lift uni a, Throwable uni fun, Typecheckable uni fun) => a -> 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.

liftProgramDef :: Lift DefaultUni a => a -> Program NamedDeBruijn DefaultUni DefaultFun () Source #

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

liftCode :: (Lift uni a, Throwable uni fun, Typecheckable uni fun) => 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.

typeCheckAgainst :: forall 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, PrettyPrintable uni fun) => Proxy a -> Term TyName Name uni fun () -> m () Source #

Check that PLC term has the given type.

typeCode :: forall 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, PrettyPrintable uni 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.