| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.Plutus.ExUnits
Synopsis
- txscriptfee ∷ Prices → ExUnits → Coin
- pointWiseExUnits ∷ (Natural → Natural → Bool) → ExUnits → ExUnits → Bool
- zipSemiExUnits ∷ Semigroup a ⇒ (Natural → Natural → a) → ExUnits → ExUnits → a
- newtype ExUnits where
- WrapExUnits { }
- pattern ExUnits ∷ Natural → Natural → ExUnits
- data ExUnits' a = ExUnits' {
- exUnitsMem' ∷ !a
- exUnitsSteps' ∷ !a
- data Prices = Prices {}
Documentation
txscriptfee ∷ Prices → ExUnits → Coin Source #
Compute the cost of a script based upon prices and the number of execution units.
pointWiseExUnits ∷ (Natural → Natural → Bool) → ExUnits → ExUnits → Bool 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
zipSemiExUnits ∷ Semigroup a ⇒ (Natural → Natural → a) → ExUnits → ExUnits → a Source #
Pointwise combine units into a semigroup and mappened the results.
This newtype wrapper of ExUnits' is used to hide an implementation detail inside the ExUnits pattern.
Constructors
| WrapExUnits | |
Fields | |
Bundled Patterns
| pattern ExUnits ∷ Natural → Natural → ExUnits | 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 We would have preferred to use a type alias for |
Instances
| FromJSON ExUnits Source # | |||||
| ToJSON ExUnits Source # | |||||
| DecCBOR ExUnits Source # | |||||
| EncCBOR ExUnits Source # | |||||
| ToPlutusData ExUnits Source # | |||||
Defined in Cardano.Ledger.Plutus.ToPlutusData | |||||
| NFData ExUnits Source # | |||||
Defined in Cardano.Ledger.Plutus.ExUnits | |||||
| Monoid ExUnits Source # | |||||
| Semigroup ExUnits Source # | |||||
| Generic ExUnits Source # | |||||
Defined in Cardano.Ledger.Plutus.ExUnits Associated Types
| |||||
| Show ExUnits Source # | |||||
| Eq ExUnits Source # | |||||
| NoThunks ExUnits Source # | |||||
| type Rep ExUnits Source # | |||||
Defined in Cardano.Ledger.Plutus.ExUnits | |||||
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
Prices per execution unit
Constructors
| Prices | |
Fields | |
Instances
| FromJSON Prices Source # | |||||
| ToJSON Prices Source # | |||||
| DecCBOR Prices Source # | |||||
| EncCBOR Prices Source # | |||||
| ToPlutusData Prices Source # | |||||
Defined in Cardano.Ledger.Plutus.ToPlutusData | |||||
| NFData Prices Source # | |||||
Defined in Cardano.Ledger.Plutus.ExUnits | |||||
| Generic Prices Source # | |||||
Defined in Cardano.Ledger.Plutus.ExUnits Associated Types
| |||||
| Show Prices Source # | |||||
| Eq Prices Source # | |||||
| Ord Prices Source # | |||||
| NoThunks Prices Source # | |||||
| type Rep Prices Source # | |||||
Defined in Cardano.Ledger.Plutus.ExUnits type Rep Prices = D1 ('MetaData "Prices" "Cardano.Ledger.Plutus.ExUnits" "cardano-ledger-core-1.19.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))) | |||||