19 lines
No EOL
659 B
Agda
19 lines
No EOL
659 B
Agda
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 Tω} → Kont Tω Tv → Value Tω Tv → StepResult Tω
|
||
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 Tω} → Exp Tω (Γ , A) B → Env Tω Γ → Value Tω A → Kont Tω B → StepResult Tω
|
||
apply-proc-clo {Γ} {A} {B} body env arg k =
|
||
let Γ′ = Γ , A in
|
||
let E′ = env [ A ∶ arg ] in
|
||
part $ mkState B Γ′ body E′ k |