Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type CostModelParams = Map Text Integer
- data CekMachineCosts
- extractCostModelParams :: ( ToJSON machinecosts, ToJSON builtincosts) => CostModel machinecosts builtincosts -> Maybe CostModelParams
- applyCostModelParams :: ( FromJSON evaluatorcosts, FromJSON builtincosts, ToJSON evaluatorcosts, ToJSON builtincosts, MonadError CostModelApplyError m) => CostModel evaluatorcosts builtincosts -> CostModelParams -> m ( CostModel evaluatorcosts builtincosts)
- data CostModelApplyError
Documentation
data CekMachineCosts Source #
Costs for evaluating AST nodes. Times should be specified in picoseconds, memory sizes in bytes.
Instances
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.
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) |
Instances
Show CostModelApplyError Source # | |
|
|
Exception CostModelApplyError Source # | |
Pretty CostModelApplyError Source # | |
Defined in PlutusCore.Evaluation.Machine.CostModelInterface pretty :: CostModelApplyError -> Doc ann Source # prettyList :: [ CostModelApplyError ] -> Doc ann Source # |