lambda-calculator-3.1.1.0: A lambda calculus interpreter
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Lambda.Untyped.State

Synopsis

Documentation

data EvalState name Source #

The evaluation state

Constructors

EvalState 

Fields

type Eval name = StateT (EvalState name) (Except LambdaException) Source #

A stateful computation

type Globals name = Map name (LambdaExpr name) Source #

A mapping of global variables to expressions

runEval :: Eval name result -> EvalState name -> Either LambdaException (result, EvalState name) Source #

Run an evalualation

execEval :: Eval name result -> EvalState name -> Either LambdaException result Source #

Run an evalualation, throwing away the final state

unsafeExecEval :: Eval name result -> EvalState name -> result Source #

Run an evaluation, throwing away the final state. If the result is an error, throws it

unsafeRunEval :: Eval name result -> EvalState name -> (result, EvalState name) Source #

Run an evaluation. If the result is an error, throws it

uniques :: Lens' (EvalState name) [name] Source #

mkEvalState :: [name] -> EvalState name Source #

Create an EvalState

getGlobals :: Eval name (Globals name) Source #

Access globals from the state monad

getUniques :: Eval name [name] Source #

Access unique supply from state monad

setGlobals :: Globals name -> Eval name () Source #

setUniques :: [name] -> Eval name () Source #