Safe Haskell | None |
---|---|
Language | Haskell98 |
This is a set of pure helpers for evaluation the InterpreterMonad
function that can be found in Puppet.Interpreter and
Puppet.Interpreter.Resolve. They are used to power some prisms from
Puppet.Lens.
> dummyEval (resolveExpression (Addition "1" "2")) Right (PString "3")
- impurePure :: ImpureMethods Identity
- pureReader :: HashMap (TopLevelType, Text) Statement -> InterpreterReader Identity
- pureEval :: Facts -> HashMap (TopLevelType, Text) Statement -> InterpreterMonad a -> (Either PrettyError a, InterpreterState, InterpreterWriter)
- dummyFacts :: Facts
- dummyEval :: InterpreterMonad a -> Either PrettyError a
Documentation
impurePure :: ImpureMethods Identity Source
Worst name ever, this is a set of pure stub for the ImpureMethods
type.
:: HashMap (TopLevelType, Text) Statement | A top-level statement map |
-> InterpreterReader Identity |
A pure InterpreterReader
, that can only evaluate a subset of the
templates, and that can include only the supplied top level statements.
:: Facts | A list of facts that will be used during evaluation |
-> HashMap (TopLevelType, Text) Statement | A top-level map |
-> InterpreterMonad a | The action to evaluate |
-> (Either PrettyError a, InterpreterState, InterpreterWriter) |
Evaluates an interpreter expression in a pure context.
A bunch of facts that can be used for pure evaluation.
dummyEval :: InterpreterMonad a -> Either PrettyError a Source
A default evaluation function for arbitrary interpreter actions.