Evaluating continuation computations #
ContT.eval finishes a continuation computation by handing it the
trivial continuation pure — [Cha14b]'s Lowering, Haskell's
evalCont, the LOWER of [BS14]. The eval_* simp lemmas
mirror ContT's run_* set: a chain of binds evaluates in bind order
and the applicative combination left-to-right, which is what lets bind
order model quantifier scope. ContT.reset evaluates and re-lifts,
delimiting scope the way scope islands do. For the linguistic
applications see Studies/Charlow2014.lean and Studies/Barker2002.lean.
References #
Interaction with the monad operations #
Evaluating lifted computations #
Lifting, combining and evaluating is combining in m, so scopal combination subsumes
applicative combination.
Resetting a lifted computation changes nothing, whatever sits on the bottom level, since evaluation leaves the side effects of the underlying monad intact ([Cha14b]'s Fact 4.1).
Resetting a combination of lifted computations is lifting their combination in m.