Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data CostModelApplyError
- type CostModelParams = Map Text Integer
- data EvaluationContext
- toMachineParameters :: ProtocolVersion -> EvaluationContext -> DefaultMachineParameters
- mkEvaluationContext :: MonadError CostModelApplyError m => CostModelParams -> m EvaluationContext
- assertWellFormedCostModelParams :: MonadError CostModelApplyError m => CostModelParams -> m ()
- costModelParamsForTesting :: CostModelParams
- evalCtxForTesting :: EvaluationContext
- costModelParamNames :: Set Text
Documentation
data CostModelApplyError #
Instances
Show CostModelApplyError | |
Exception CostModelApplyError | |
Pretty CostModelApplyError | |
Defined in PlutusCore.Evaluation.Machine.CostModelInterface pretty :: CostModelApplyError -> Doc ann prettyList :: [CostModelApplyError] -> Doc ann |
type CostModelParams = Map Text Integer #
data EvaluationContext Source #
An opaque type that contains all the static parameters that the evaluator needs to evaluate a script. This is so that they can be computed once and cached, rather than recomputed on every evaluation.
There are two sets of parameters: one is with immediate unlifting and the other one is with deferred unlifting. We have to keep both of them, because depending on the language version either one has to be used or the other. We also compile them separately due to all the inlining and optimization that need to happen for things to be efficient.
Instances
mkEvaluationContext :: MonadError CostModelApplyError m => CostModelParams -> m EvaluationContext Source #
Build the EvaluationContext
.
The input is a Map
of strings to cost integer values (aka CostModelParams
, CostModel
)
See Note [Inlining meanings of builtins].
assertWellFormedCostModelParams :: MonadError CostModelApplyError m => CostModelParams -> m () Source #
Comparably expensive to mkEvaluationContext
, so it should only be used sparingly.
costModelParamsForTesting :: CostModelParams Source #
The raw cost model params, only to be used for testing purposes.
evalCtxForTesting :: EvaluationContext Source #
only to be for testing purposes: make an evaluation context by applying an empty set of protocol parameters
costModelParamNames :: Set Text Source #
The set of valid names that a cost model parameter can take for this language version.
It is used for the deserialization of CostModelParams
.