cek-call-cc/src/Project/Do.agda
2021-12-09 06:02:52 -06:00

19 lines
No EOL
659 B
Agda
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module Project.Do where
open import Project.Definitions
open import Project.Util
data StepResult (A : Type) : Set where
part : State A StepResult A
done : Value A A StepResult A
apply-kont : {Tv } Kont Tv Value Tv StepResult
apply-kont {Tv} (kont (letk {Tc} Γ C E K)) v =
part $ mkState Tc (Γ , Tv) C (E [ Tv v ]) K
apply-kont halt v = done v
apply-proc-clo : {Γ A B } Exp (Γ , A) B Env Γ Value A Kont B StepResult
apply-proc-clo {Γ} {A} {B} body env arg k =
let Γ′ = Γ , A in
let E = env [ A arg ] in
part $ mkState B Γ′ body E k