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

Safe HaskellNone
LanguageHaskell98

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 Identity Source

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

pureReader Source

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.

pureEval Source

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 :: Facts Source

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.