Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data EvalState name = EvalState {}
- type Eval name = StateT (EvalState name) (Except LambdaException)
- type Globals name = Map name (LambdaExpr name)
- runEval :: Eval name result -> EvalState name -> Either LambdaException (result, EvalState name)
- execEval :: Eval name result -> EvalState name -> Either LambdaException result
- unsafeExecEval :: Eval name result -> EvalState name -> result
- unsafeRunEval :: Eval name result -> EvalState name -> (result, EvalState name)
- globals :: Lens' (EvalState name) (Globals name)
- uniques :: Lens' (EvalState name) [name]
- mkEvalState :: [name] -> EvalState name
- getGlobals :: Eval name (Globals name)
- getUniques :: Eval name [name]
- setGlobals :: Globals name -> Eval name ()
- setUniques :: [name] -> Eval name ()
Documentation
The evaluation state
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
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 #