language-puppet-1.0.0: Tools to parse and evaluate the Puppet DSL.

Safe HaskellNone

Puppet.Interpreter.Pure

Description

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")

Synopsis

Documentation

impurePure :: ImpureMethods IdentitySource

Worst name ever, this is a set of pure stub for the ImpureMethods type.

pureReaderSource

Arguments

:: 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.

pureEvalSource

Arguments

:: 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.

dummyFacts :: FactsSource

A bunch of facts that can be used for pure evaluation.

dummyEval :: InterpreterMonad a -> Either PrettyError aSource

A default evaluation function for arbitrary interpreter actions.