plutus-core-1.0.0.1: Language library for Plutus Core
Safe HaskellNone
LanguageHaskell2010

PlutusCore.Evaluation.Machine.CostModelInterface

Synopsis

Documentation

data CekMachineCosts Source #

Costs for evaluating AST nodes. Times should be specified in picoseconds, memory sizes in bytes.

Instances

Instances details
Eq CekMachineCosts Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts

Show CekMachineCosts Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts

Generic CekMachineCosts Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts

Associated Types

type Rep CekMachineCosts :: Type -> Type Source #

NFData CekMachineCosts Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts

Methods

rnf :: CekMachineCosts -> () Source #

FromJSON CekMachineCosts Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts

Methods

parseJSON :: Value -> Parser CekMachineCosts

parseJSONList :: Value -> Parser [CekMachineCosts]

ToJSON CekMachineCosts Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts

Methods

toJSON :: CekMachineCosts -> Value

toEncoding :: CekMachineCosts -> Encoding

toJSONList :: [CekMachineCosts] -> Value

toEncodingList :: [CekMachineCosts] -> Encoding

NoThunks CekMachineCosts Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts

Methods

noThunks :: Context -> CekMachineCosts -> IO (Maybe ThunkInfo)

wNoThunks :: Context -> CekMachineCosts -> IO (Maybe ThunkInfo)

showTypeOf :: Proxy CekMachineCosts -> String

Lift CekMachineCosts Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts

type Rep CekMachineCosts Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts

type Rep CekMachineCosts = D1 ('MetaData "CekMachineCosts" "UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts" "plutus-core-1.0.0.1-6wMiyL0yerXJu56t8zBoKx" 'False) (C1 ('MetaCons "CekMachineCosts" 'PrefixI 'True) (((S1 ('MetaSel ('Just "cekStartupCost") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExBudget) :*: S1 ('MetaSel ('Just "cekVarCost") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExBudget)) :*: (S1 ('MetaSel ('Just "cekConstCost") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExBudget) :*: S1 ('MetaSel ('Just "cekLamCost") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExBudget))) :*: ((S1 ('MetaSel ('Just "cekDelayCost") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExBudget) :*: S1 ('MetaSel ('Just "cekForceCost") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExBudget)) :*: (S1 ('MetaSel ('Just "cekApplyCost") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExBudget) :*: S1 ('MetaSel ('Just "cekBuiltinCost") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExBudget)))))

extractCostModelParams :: (ToJSON machinecosts, ToJSON builtincosts) => CostModel machinecosts builtincosts -> Maybe CostModelParams Source #

Given a CostModel, produce a single map containing the parameters from both components

applyCostModelParams :: (FromJSON evaluatorcosts, FromJSON builtincosts, ToJSON evaluatorcosts, ToJSON builtincosts, MonadError CostModelApplyError m) => CostModel evaluatorcosts builtincosts -> CostModelParams -> m (CostModel evaluatorcosts builtincosts) Source #

Update a CostModel for the CEK machine with a given set of parameters,

data CostModelApplyError Source #

The type of errors that applyParams can throw.

Constructors

CMUnknownParamError Text

a costmodel parameter with the give name does not exist in the costmodel to be applied upon

CMInternalReadError

internal error when we are transforming the applyParams' input to json (should not happen)

CMInternalWriteError String

internal error when we are transforming the applied params from json with given jsonstring error (should not happen)