pure (vds, fds)
semFunDecl :: FunDecl -> Env FunDecl
-semFunDecl f = pure f
+semFunDecl fd=:(FunDecl p f _ mt vds stmts) = case mt of
+ Nothing = let t = IdType f in putIdent f t >>| pure fd
+ Just t = putIdent f t >>| pure fd
semVarDecl :: VarDecl -> Env VarDecl
semVarDecl (VarDecl pos type ident ex) = unify type ex
putIdent frsh t >>| pure t
typeExpr (FunExpr p (FunCall f es)) = gets (\(st, r)->'Map'.get f st)
>>= \mt-> case mt of
- Nothing = undef
+ Nothing = let t = IdType f in putIdent f t >>| pure t
Just t = unifyApp t es
-//ignore field selectors
typeExpr (VarExpr p (VarDef ident fs)) = gets (\(st, r)->'Map'.get ident st)
>>= \mt->case mt of
Nothing = liftT $ Left $ UndeclaredVariableError p ident
- //let t = IdType ident in putIdent ident t >>| pure t
Just t = unify t fs
unifyApp :: Type [Expr] -> Env Type