- session <- getSession
- prev_context <- io $ GHC.getContext session
- result <- io (GHC.checkModule session modl False)
- case result of
- Nothing -> io $ putStrLn "Nothing"
- Just r -> io $ putStrLn (showSDoc (
- case GHC.checkedModuleInfo r of
- Just cm | Just scope <- GHC.modInfoTopLevelScope cm ->
+ prev_context <- GHC.getContext
+ ok <- handleSourceError (\e -> GHC.printExceptionAndWarnings e >> return False) $ do
+ r <- GHC.typecheckModule =<< GHC.parseModule modl
+ io $ putStrLn (showSDoc (
+ case GHC.moduleInfo r of
+ cm | Just scope <- GHC.modInfoTopLevelScope cm ->