[use 'hint' hint for typechecking
martin.hofmann@uni-bamberg.de**20090514111947] hunk ./src/Main.hs 15
-main = do
-    a     <-  getArgs
-    (o,c) <- igorOpts a    
-    putStrLn.unwords $ "ARGs: " : a
-    putStrLn $ "OPTs: " ++ (show o)    
-    putStrLn.unwords $ "CMDs: " : c    
-    startUIWith (o,c) 
-
---getArgs >>= compilerOpts >>= startUIWith
+main = getArgs >>= igorOpts >>= startUIWith
hunk ./src/UI/IOInterpreter.hs 2
-module UI.IOInterpreter (interprete) where
+module UI.IOInterpreter (interprete, typecheck) where
hunk ./src/UI/IOInterpreter.hs 8
+typecheck f = do
+    ok <- runInterpreter $ loadModules [f]
+    case ok of
+        Right _  -> return True
+        Left _   -> return False
+    
hunk ./src/UI/IOTypeCheck.hs 1
-
-module UI.IOTypeCheck where
-
-import GHC
-import GHC.Paths ( libdir )
-import DynFlags ( defaultDynFlags )
-import Control.Monad.Error
- 
-typecheck f = do
-    ok <- typecheck_ f
-    case ok of
-        Succeeded -> return True
-        Failed    -> return False
-
--- TODO this is not nice. I would prefer to catch the error myself and not get a
--- SuccessFlag 
-typecheck_ :: FilePath -> IO SuccessFlag
-typecheck_ p = (do
-   -- defaultErrorHandler defaultDynFlags $ do
-     runGhc (Just libdir) $ do
-        dflags <- getSessionDynFlags
-        setSessionDynFlags dflags
-        target <- guessTarget p Nothing
-        setTargets [target]
-        load LoadAllTargets)
+
rmfile ./src/UI/IOTypeCheck.hs
hunk ./src/UI/UIStarter.hs 26
-import UI.IOTypeCheck
+--import UI.IOTypeCheck
hunk ./src/UI/UIStarter.hs 44
---startUI :: IO ()
---startUI = getArgs >>= startUIWith
---
---startUIWith :: [String] -> IO()
---startUIWith args = 
---    let state = defaultState
---    in case args of
---        []      -> runInteractive state
---        (f:_)   -> do 
---                    e <- doesFileExist f
---                    if e then
---                        runBatch state f
---                      else          
---                        usage >> exitWith (ExitFailure 1)
+
hunk ./src/UI/UIStarter.hs 205
-      then do ok <- (typecheck  path) 
+      then do ok <- (typecheck  path)