rc #13

Merged
crumbtoo merged 196 commits from dev into main 2024-02-13 13:22:23 -07:00
Showing only changes of commit 52b7723ea0 - Show all commits

View File

@@ -76,7 +76,7 @@ gather :: Context' -> Expr' -> HMError (Type, [Constraint])
gather = \g e -> runStateT (go g e) ([],0) <&> \ (t,(cs,_)) -> (t,cs) where gather = \g e -> runStateT (go g e) ([],0) <&> \ (t,(cs,_)) -> (t,cs) where
go :: Context' -> Expr' -> StateT ([Constraint], Int) HMError Type go :: Context' -> Expr' -> StateT ([Constraint], Int) HMError Type
go g = \case go g = \case
LitE (IntL _) -> pure TyInt Lit (IntL _) -> pure TyInt
Var k -> lift $ maybe e Right $ lookup k g Var k -> lift $ maybe e Right $ lookup k g
where e = Left (TyErrUntypedVariable k) where e = Left (TyErrUntypedVariable k)
App f x -> do App f x -> do