cardano-ledger-core-1.15.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Plutus.ExUnits

Synopsis

Documentation

txscriptfeePricesExUnitsCoin Source #

Compute the cost of a script based upon prices and the number of execution units.

pointWiseExUnits ∷ (NaturalNaturalBool) → ExUnitsExUnitsBool Source #

It is deliberate that there is no Ord instance for ExUnits. Use this function to compare if one ExUnit is pointwise compareable to another. In case when Ord instance like comparison is necessary you can use zipSemiExUnits compare

zipSemiExUnitsSemigroup a ⇒ (NaturalNatural → a) → ExUnitsExUnits → a Source #

Pointwise combine units into a semigroup and mappened the results.

newtype ExUnits Source #

This newtype wrapper of ExUnits' is used to hide an implementation detail inside the ExUnits pattern.

Constructors

WrapExUnits 

Bundled Patterns

pattern ExUnitsNaturalNaturalExUnits

Arbitrary execution unit in which we measure the cost of scripts in terms of space in memory and execution time.

This pattern hides the fact that ExUnits' is parametric in the underlying type. The ledger itself uses ExUnits Natural' exclusively.

We would have preferred to use a type alias for ExUnits Natural', but this is not possible: https://gitlab.haskell.org/ghc/ghc/-/issues/19507.

Instances

Instances details
FromJSON ExUnits Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

ToJSON ExUnits Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Monoid ExUnits Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Semigroup ExUnits Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Generic ExUnits Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Associated Types

type Rep ExUnitsTypeType Source #

Methods

fromExUnitsRep ExUnits x Source #

toRep ExUnits x → ExUnits Source #

Show ExUnits Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

DecCBOR ExUnits Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

EncCBOR ExUnits Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Methods

encCBORExUnitsEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy ExUnitsSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [ExUnits] → Size Source #

ToPlutusData ExUnits Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ToPlutusData

NFData ExUnits Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Methods

rnfExUnits → () Source #

Eq ExUnits Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Methods

(==)ExUnitsExUnitsBool Source #

(/=)ExUnitsExUnitsBool Source #

NoThunks ExUnits Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

type Rep ExUnits Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

type Rep ExUnits = D1 ('MetaData "ExUnits" "Cardano.Ledger.Plutus.ExUnits" "cardano-ledger-core-1.15.0.0-inplace" 'True) (C1 ('MetaCons "WrapExUnits" 'PrefixI 'True) (S1 ('MetaSel ('Just "unWrapExUnits") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ExUnits' Natural))))

data ExUnits' a Source #

Arbitrary execution unit in which we measure the cost of scripts in terms of space in memory and execution time.

The ledger itself uses ExUnits Natural' exclusively, but the flexibility here allows the consensus layer to translate the execution units into something equivalent to 'ExUnits (Inf Natural)'. This is needed in order to provide a BoundedMeasure instance, which itself is needed for the alonzo instance of TxLimits (in consensus).

Constructors

ExUnits' 

Fields

Instances

Instances details
Functor ExUnits' Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Methods

fmap ∷ (a → b) → ExUnits' a → ExUnits' b Source #

(<$) ∷ a → ExUnits' b → ExUnits' a Source #

FromJSON a ⇒ FromJSON (ExUnits' a) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

ToJSON a ⇒ ToJSON (ExUnits' a) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Measure a ⇒ Monoid (ExUnits' a) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Measure a ⇒ Semigroup (ExUnits' a) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Methods

(<>)ExUnits' a → ExUnits' a → ExUnits' a Source #

sconcatNonEmpty (ExUnits' a) → ExUnits' a Source #

stimesIntegral b ⇒ b → ExUnits' a → ExUnits' a Source #

Generic (ExUnits' a) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Associated Types

type Rep (ExUnits' a) ∷ TypeType Source #

Methods

fromExUnits' a → Rep (ExUnits' a) x Source #

toRep (ExUnits' a) x → ExUnits' a Source #

Show a ⇒ Show (ExUnits' a) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

NFData a ⇒ NFData (ExUnits' a) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Methods

rnfExUnits' a → () Source #

Eq a ⇒ Eq (ExUnits' a) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Methods

(==)ExUnits' a → ExUnits' a → Bool Source #

(/=)ExUnits' a → ExUnits' a → Bool Source #

BoundedMeasure a ⇒ BoundedMeasure (ExUnits' a) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Methods

maxBoundExUnits' a Source #

Measure a ⇒ Measure (ExUnits' a) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Methods

zeroExUnits' a Source #

plusExUnits' a → ExUnits' a → ExUnits' a Source #

minExUnits' a → ExUnits' a → ExUnits' a Source #

maxExUnits' a → ExUnits' a → ExUnits' a Source #

NoThunks a ⇒ NoThunks (ExUnits' a) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

type Rep (ExUnits' a) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

type Rep (ExUnits' a) = D1 ('MetaData "ExUnits'" "Cardano.Ledger.Plutus.ExUnits" "cardano-ledger-core-1.15.0.0-inplace" 'False) (C1 ('MetaCons "ExUnits'" 'PrefixI 'True) (S1 ('MetaSel ('Just "exUnitsMem'") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "exUnitsSteps'") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)))

data Prices Source #

Prices per execution unit

Instances

Instances details
FromJSON Prices Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

ToJSON Prices Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Generic Prices Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Associated Types

type Rep PricesTypeType Source #

Methods

fromPricesRep Prices x Source #

toRep Prices x → Prices Source #

Show Prices Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

DecCBOR Prices Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

EncCBOR Prices Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Methods

encCBORPricesEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy PricesSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Prices] → Size Source #

ToPlutusData Prices Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ToPlutusData

NFData Prices Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Methods

rnfPrices → () Source #

Eq Prices Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

Methods

(==)PricesPricesBool Source #

(/=)PricesPricesBool Source #

Ord Prices Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

NoThunks Prices Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

type Rep Prices Source # 
Instance details

Defined in Cardano.Ledger.Plutus.ExUnits

type Rep Prices = D1 ('MetaData "Prices" "Cardano.Ledger.Plutus.ExUnits" "cardano-ledger-core-1.15.0.0-inplace" 'False) (C1 ('MetaCons "Prices" 'PrefixI 'True) (S1 ('MetaSel ('Just "prMem") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NonNegativeInterval) :*: S1 ('MetaSel ('Just "prSteps") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NonNegativeInterval)))