$ extend "1printbool" (Forall [] (BoolType ->> VoidType))
zero
-sem :: AST -> Either [SemError] AST
+sem :: AST -> Either [SemError] (AST, Gamma)
sem (AST fd) = case foldM (const $ hasNoDups fd) () fd
>>| foldM (const isNiceMain) () fd
>>| hasMain fd
- >>| evalStateT (type fd) (defaultGamma, variableStream) of
+ >>| runStateT (type fd) (defaultGamma, variableStream) of
Left e = Left [e]
- Right (_,fds) = Right (AST fds)
+ Right ((_,fds),(gam,_)) = Right (AST fds, gam)
where
hasNoDups :: [FunDecl] FunDecl -> Either SemError ()
hasNoDups fds (FunDecl p n _ _ _ _)