Rename variables
This commit is contained in:
parent
e138cb27ec
commit
2cb8527848
1 changed files with 8 additions and 7 deletions
|
|
@ -337,6 +337,7 @@ infer (EAdd e1 e2) = do
|
||||||
e2' <- check e2 int
|
e2' <- check e2 int
|
||||||
apply (T.EAdd e1' e2', int)
|
apply (T.EAdd e1' e2', int)
|
||||||
|
|
||||||
|
--FIXME
|
||||||
-- Γ ⊢ e ↑ A ⊣ Θ Θ ⊢ Π ∷ [Θ]A ↑ C ⊣ Δ
|
-- Γ ⊢ e ↑ A ⊣ Θ Θ ⊢ Π ∷ [Θ]A ↑ C ⊣ Δ
|
||||||
-- ------------------------------------ Case
|
-- ------------------------------------ Case
|
||||||
-- Γ ⊢ case e of Π ↓ C ⊣ Δ
|
-- Γ ⊢ case e of Π ↓ C ⊣ Δ
|
||||||
|
|
@ -345,15 +346,15 @@ infer (ECase scrut pi) = do
|
||||||
case pi of
|
case pi of
|
||||||
[] -> apply (T.ECase (scrut', a) [], a)
|
[] -> apply (T.ECase (scrut', a) [], a)
|
||||||
(Branch _ e):_ -> do
|
(Branch _ e):_ -> do
|
||||||
(_, c)<- infer e
|
(_, b)<- infer e
|
||||||
(pi', c') <- foldlM go ([], c) pi
|
(pi', b') <- foldlM go ([], b) pi
|
||||||
apply (T.ECase (scrut', a) pi', c')
|
apply (T.ECase (scrut', a) pi', b')
|
||||||
where
|
where
|
||||||
go (bs, c) (Branch p e) = do
|
go (pi, b) (Branch p e) = do
|
||||||
p' <- checkPattern p =<< apply a
|
p' <- checkPattern p =<< apply a
|
||||||
e'@(_, c') <- infer e
|
e'@(_, b') <- infer e
|
||||||
subtype c' c
|
subtype b' b
|
||||||
apply (T.Branch p' e' : bs, c')
|
apply (T.Branch p' e' : pi, b')
|
||||||
|
|
||||||
-- | Γ ⊢ A • e ⇓ C ⊣ Δ
|
-- | Γ ⊢ A • e ⇓ C ⊣ Δ
|
||||||
-- Under input context Γ , applying a function of type A to e infers type C, with output context ∆
|
-- Under input context Γ , applying a function of type A to e infers type C, with output context ∆
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue