-semFunDecl fd=:(FunDecl p f _ mt vds stmts) = mapM_ semVarDecl vds >>|
- mapM_ (checkStmt IntType) stmts >>|
- case mt of
- Nothing = let t = IdType f in putIdent f t >>| pure fd
- Just t = putIdent f t >>| pure fd
+semFunDecl fd=:(FunDecl p f args mt vds stmts) = (case mt of
+ Nothing = let t = IdType f in putIdent f t >>| pure t//typeFun f args
+ Just t = putIdent f t >>| pure t) >>= \ft ->
+ mapM_ semVarDecl vds >>|
+ mapM_ (checkStmt $ resultType ft) stmts >>| pure fd
+ //case mt of
+// Nothing = let t = IdType f in putIdent f t >>| pure fd
+// Just t = putIdent f t >>| pure fd