iStmt (SSet ident value) = do t1 <- askType ident
                              t2 <- getType value
                              if t2 == TFunc then
                                do exp <- calcExp value
                                   t3 <- getType exp
                                   if t1 == t3 then
                                     do loc <- getLoc ident
                                        putToStore loc exp
                                        return Null
                                   else
                                     do putStr_Err $ show t3 ++ " cannot be set to " ++ show t1
                                        return Null
                              else
                                if t1 == t2 then
                                 do loc <- getLoc ident
                                    -- Debug
                                    exp <- calcExp value
                                    putToStore loc exp
                                    return Null
                                else
                                    do putStr_IO $ show t2 ++ " cannot be set to " ++ show t1
                                       return Null
iStmt (SSet ident value) = do t1 <- askType ident
                              t2 <- getType value
                              if t2 == TFunc then
                                do exp <- calcExp value
                                   t3 <- getType exp
                                   if t1 == t3 then
                                     do loc <- getLoc ident
                                        putToStore loc exp
                                        return Null
                                   else
                                     do putStr_Err $ show t3 ++ " cannot be set to " ++ show t1
                                        return Null
                              else
                                if t1 == t2 then
                                 do loc <- getLoc ident
                                    -- Debug
                                    exp <- calcExp value
                                    putToStore loc exp
                                    return Null
                                else
                                    do putStr_IO $ show t2 ++ " cannot be set to " ++ show t1
                                       return Null
iStmt (SSet ident value) = do t1 <- askType ident
                              t2 <- getType value
                              if t2 == TFunc then
                                do exp <- calcExp value
                                   t3 <- getType exp
                                   if t1 == t3 then
                                     do loc <- getLoc ident
                                        putToStore loc exp
                                        return Null
                                   else
                                     do putStr_Err $ show t3 ++ " cannot be set to " ++ show t1
                                        return Null
                              else
                                if t1 == t2 then
                                 do loc <- getLoc ident
                                    -- Debug
                                    exp <- calcExp value
                                    putToStore loc exp
                                    return Null
                                else
                                    do putStr_IO $ show t2 ++ " cannot be set to " ++ show t1
                                       return Null