| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
PlutusTx.Code
Synopsis
- data CompiledCodeIn (uni :: Type -> Type) fun a
- = SerializedCode ByteString (Maybe ByteString) CoverageIndex
- | DeserializedCode (Program NamedDeBruijn uni fun SrcSpans) (Maybe (Program TyName Name uni fun SrcSpans)) CoverageIndex
- type CompiledCode = CompiledCodeIn DefaultUni DefaultFun
- 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
- countAstNodes :: forall (uni :: Type -> Type) fun a. (Closed uni, Everywhere uni Flat, Flat fun) => CompiledCodeIn uni fun a -> Integer
- newtype ImpossibleDeserialisationFailure = ImpossibleDeserialisationFailure DecodeException
- 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 ())
- getCovIdx :: forall (uni :: Type -> Type) fun a. CompiledCodeIn uni fun a -> CoverageIndex
Documentation
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.
Constructors
| SerializedCode | |
Fields
| |
| DeserializedCode | |
Fields
| |
type CompiledCode = CompiledCodeIn DefaultUni DefaultFun Source #
CompiledCodeIn instantiated with default built-in types and functions.
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.
countAstNodes :: forall (uni :: Type -> Type) fun a. (Closed uni, Everywhere uni Flat, Flat fun) => CompiledCodeIn uni fun a -> Integer Source #
The size of a CompiledCodeIn as measured in AST nodes.
newtype ImpossibleDeserialisationFailure Source #
Constructors
| ImpossibleDeserialisationFailure DecodeException |
Instances
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 #
getCovIdx :: forall (uni :: Type -> Type) fun a. CompiledCodeIn uni fun a -> CoverageIndex Source #