safeLoad mode = do
_dflags <- getSessionDynFlags
ghandle (\(e :: SomeException) -> liftIO (print e) >> return Failed ) $
- handleSourceError (\e -> printExceptionAndWarnings e >> return Failed) $
+ handleSourceError (\e -> printException e >> return Failed) $
load mode
let filename = msHsFilePath ms
modname = moduleName $ ms_mod ms
in handleSourceError (\e -> do
- printExceptionAndWarnings e
+ printException e
liftIO $ exitWith (ExitFailure 1)) $
do liftIO $ putStrLn ("loading " ++ filename)
mod <- loadModule =<< typecheckModule =<< parseModule ms
in case unLoc lpat of
WildPat _ -> tl
VarPat name -> lid name : tl
- VarPatOut name _ -> lid name : tl -- XXX need help here
LazyPat p -> patThings p tl
AsPat id p -> patThings p (thing id : tl)
ParPat p -> patThings p tl