Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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.
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 # | |
Monoid ExUnits Source # | |
Semigroup ExUnits Source # | |
Generic ExUnits Source # | |
Show 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 | |
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).
ExUnits' | |
|
Instances
Functor ExUnits' Source # | |
FromJSON a ⇒ FromJSON (ExUnits' a) Source # | |
ToJSON a ⇒ ToJSON (ExUnits' a) Source # | |
Measure a ⇒ Monoid (ExUnits' a) Source # | |
Measure a ⇒ Semigroup (ExUnits' a) Source # | |
Generic (ExUnits' a) Source # | |
Show a ⇒ Show (ExUnits' a) Source # | |
NFData a ⇒ NFData (ExUnits' a) Source # | |
Defined in Cardano.Ledger.Plutus.ExUnits | |
Eq a ⇒ Eq (ExUnits' a) Source # | |
BoundedMeasure a ⇒ BoundedMeasure (ExUnits' a) Source # | |
Defined in Cardano.Ledger.Plutus.ExUnits | |
Measure a ⇒ Measure (ExUnits' a) Source # | |
NoThunks a ⇒ NoThunks (ExUnits' a) Source # | |
type Rep (ExUnits' a) Source # | |
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))) |
Prices per execution unit
Instances
FromJSON Prices Source # | |
ToJSON Prices Source # | |
Generic Prices Source # | |
Show 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 | |
Eq Prices Source # | |
Ord Prices Source # | |
Defined in Cardano.Ledger.Plutus.ExUnits | |
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.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))) |