Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data EvaluationContext
- mkEvaluationContext :: MonadError CostModelApplyError m => CostModelParams -> m EvaluationContext
- type CostModelParams = Map Text Integer
- assertWellFormedCostModelParams :: MonadError CostModelApplyError m => CostModelParams -> m ()
- machineParametersImmediate :: EvaluationContext -> DefaultMachineParameters
- machineParametersDeferred :: EvaluationContext -> DefaultMachineParameters
- toMachineParameters :: ProtocolVersion -> EvaluationContext -> DefaultMachineParameters
- costModelParamNames :: Set Text
- costModelParamsForTesting :: CostModelParams
- evalCtxForTesting :: EvaluationContext
- data CostModelApplyError
Documentation
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].
type CostModelParams = Map Text Integer #
assertWellFormedCostModelParams :: MonadError CostModelApplyError m => CostModelParams -> m () Source #
Comparably expensive to mkEvaluationContext
, so it should only be used sparingly.
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
.
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
data CostModelApplyError #
Instances
Show CostModelApplyError | |
Exception CostModelApplyError | |
Pretty CostModelApplyError | |
Defined in PlutusCore.Evaluation.Machine.CostModelInterface pretty :: CostModelApplyError -> Doc ann prettyList :: [CostModelApplyError] -> Doc ann |