+findVariable :: (MonadState Types m) => Ident -> Types -> m Type
+findVariable i [] = fail $ "Variable "++show i++" not found in any scope."
+findVariable i (m:ms) = if member i m then lookup i m else findVariable i ms
+
+pushAndPop :: (MonadState Types m) => m a -> m ()
+pushAndPop s = do
+ modify (empty:)
+ s
+ modify tail
+
+typeCheckStm :: (MonadState Types m) => Stm -> m ()
+typeCheckStm SNoop = return ()