plutus-core-1.30.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusCore.Evaluation.Machine.ExMemoryUsage

Synopsis

Documentation

data CostRose Source #

A lazy tree of costs. Convenient for calculating the costs of values of built-in types, because they may have arbitrary branching (in particular a Data object can contain a list of Data objects inside of it).

CostRose gets collapsed to a lazy linear structure down the pipeline, so that we can stream the costs to the outside where, say, the CEK machine picks them up one by one and handles somehow (in particular, subtracts from the remaining budget).

Constructors

CostRose !CostingInteger ![CostRose] 

Instances

Instances details
Show CostRose Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

singletonRoseCostingIntegerCostRose Source #

Create a CostRose containing a single cost.

class ExMemoryUsage a where Source #

Methods

memoryUsage ∷ a → CostRose Source #

Instances

Instances details
ExMemoryUsage Word8 Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

ExMemoryUsage ByteString Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

Methods

memoryUsage ∷ ByteString → CostRose Source #

ExMemoryUsage Element Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

ExMemoryUsage Element Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

ExMemoryUsage MlResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

ExMemoryUsage Data Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

ExMemoryUsage DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

ExMemoryUsage LiteralByteSize Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

ExMemoryUsage Text Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

Methods

memoryUsage ∷ Text → CostRose Source #

ExMemoryUsage Integer Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

ExMemoryUsage () Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

Methods

memoryUsage ∷ () → CostRose Source #

ExMemoryUsage Bool Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

ExMemoryUsage Char Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

ExMemoryUsage Int Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

ExMemoryUsage (SomeTypeIn uni) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

ExMemoryUsage a ⇒ ExMemoryUsage [a] Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

Methods

memoryUsage ∷ [a] → CostRose Source #

ExMemoryUsage val ⇒ ExMemoryUsage (Opaque val rep) Source # 
Instance details

Defined in PlutusCore.Builtin.Polymorphism

Methods

memoryUsageOpaque val rep → CostRose Source #

(Everywhere uni ExMemoryUsage, Closed uni) ⇒ ExMemoryUsage (SomeConstant uni rep) Source # 
Instance details

Defined in PlutusCore.Builtin.Polymorphism

Methods

memoryUsageSomeConstant uni rep → CostRose Source #

ExMemoryUsage (CkValue uni fun) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Ck

Methods

memoryUsageCkValue uni fun → CostRose Source #

(Closed uni, Everywhere uni ExMemoryUsage) ⇒ ExMemoryUsage (Some (ValueOf uni)) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

Methods

memoryUsageSome (ValueOf uni) → CostRose Source #

(ExMemoryUsage a, ExMemoryUsage b) ⇒ ExMemoryUsage (a, b) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

Methods

memoryUsage ∷ (a, b) → CostRose Source #

(Closed uni, Everywhere uni ExMemoryUsage) ⇒ ExMemoryUsage (CekValue uni fun ann) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

memoryUsageCekValue uni fun ann → CostRose Source #

ExMemoryUsage (Term tyname name uni fun ann) Source # 
Instance details

Defined in PlutusCore.Core.Type

Methods

memoryUsageTerm tyname name uni fun ann → CostRose Source #

flattenCostRoseCostRoseCostStream Source #

Collapse a CostRose to a lazy linear stream of costs. Retrieving the next element takes O(1) time in the worst case regardless of the recursion pattern of the given CostRose.

newtype LiteralByteSize Source #

When invoking a built-in function, a value of type LiteralByteSize can be used transparently as a built-in Integer but with a different size measure: see Note [Integral types as Integer]. This is required by the integerToByteString builtin, which takes an argument w specifying the width (in bytes) of the output bytestring (zero-padded to the desired size). The memory consumed by the function is given by w, *not* the size of w. The LiteralByteSize type wraps an Integer w in a newtype whose ExMemoryUsage is equal to the number of eight-byte words required to contain w bytes, allowing its costing function to work properly.

Constructors

LiteralByteSize 

Instances

Instances details
ExMemoryUsage LiteralByteSize Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage

HasConstantIn DefaultUni term ⇒ MakeKnownIn DefaultUni term LiteralByteSize Source # 
Instance details

Defined in PlutusCore.Default.Universe

HasConstantIn DefaultUni term ⇒ ReadKnownIn DefaultUni term LiteralByteSize Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownTypeAst tyname DefaultUni LiteralByteSize Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

typeAstType tyname DefaultUni () Source #

type IsBuiltin DefaultUni LiteralByteSize Source # 
Instance details

Defined in PlutusCore.Default.Universe

type ToHoles DefaultUni LiteralByteSize Source # 
Instance details

Defined in PlutusCore.Default.Universe

type ToBinds DefaultUni acc LiteralByteSize Source # 
Instance details

Defined in PlutusCore.Default.Universe