ddc-core-eval-0.2.1.2: Disciple Core language semantic evaluator.

Safe HaskellNone

DDC.Core.Eval.Step

Description

Single step evalation for the Disciple Core language.

Synopsis

Documentation

data StepResult Source

The result of stepping some expression.

Constructors

StepProgress Store (Exp () Name)

Expression progressed to a new state.

StepDone

Expression cannot step and is a (weak) value. We're done already.

StepStuck

Expression cannot step, and is not a (weak) value. The original expression was mistyped, or something is wrong with the interpreter.

StepStuckMistyped (Error () Name)

Expression is stuck, and we know for sure it's mistyped.

Instances

forceSource

Arguments

:: Store

Current store.

-> Exp () Name

Expression to force.

-> StepResult

Result of forcing it.

Single step a core expression to a value.

As opposed to step, if the provided expression is the location of a Thunk, then the thunk will be forced.

stepSource

Arguments

:: Store

Current store.

-> Exp () Name

Expression to step.

-> StepResult

Result of stepping it.

Single step a code expression to a weak value.

As opposed to force, if the provided expression is the location of a Thunk, then the thunk is not forced.

isValue :: Store -> Exp a Name -> BoolSource

Check if an expression is a value. Values can't be progressed any further, with either force or step.

isWeakValue :: Store -> Exp a Name -> BoolSource

Check if an expression is a weak values. These are all the values, and locations that point to thunks.

Weak values can be progressed with force, but not step.