[The typechecker now verifies that the main function has a type that can be unified with IO a. This is required by the Haskell 98 Report.
jcpetruzza@gmail.com**20120211050446
 Ignore-this: 8a1d8ca36929c0de0fb4357538ea6c5b
 
 Failing to do so allows both to accept invalid programs like:
 
 > main :: [()]
 > main = return ()
 
 and to reject valid programs like:
 
 > main = return ()
 
] hunk ./src/FrontEnd/Tc/Main.hs 711
+    mainFunc <- nameOfMainFunc
+    when ( v == mainFunc ) $ do
+       tMain <- typeOfMainFunc
+       typ `subsumes` tMain
+       return ()
hunk ./src/FrontEnd/Tc/Main.hs 755
+typeOfMainFunc :: Tc Type
+typeOfMainFunc = do
+    a <- newMetaVar Tau kindStar
+    -- a <- newMetaVar Tau kindStar
+    -- a <- Tvar `fmap` newVar kindStar
+    return $ tAp (TCon (Tycon tc_IO (Kfun kindStar kindStar))) a
+
+nameOfMainFunc :: Tc Name
+nameOfMainFunc = fmap (parseName Val . maybe "Main.main" snd . optMainFunc) getOptions
+