- doDump switch hdr string
- = if switch
- then hPutStr stderr ("\n\n" ++ (take 80 $ repeat '=')) >>
- hPutStr stderr ('\n': hdr) >>
- hPutStr stderr ('\n': string) >>
- hPutStr stderr "\n"
- else return ()
-
-
-pprCols = (80 :: Int) -- could make configurable
-
-(pprStyle, pprErrorsStyle)
- | opt_PprStyle_All = (PprShowAll, PprShowAll)
- | opt_PprStyle_Debug = (PprDebug, PprDebug)
- | opt_PprStyle_User = (PprQuote, PprQuote)
- | otherwise = (PprDebug, PprQuote)
-
-pp_show p = show p -- ToDo: use pprCols
-
-checkErrors errs_bag warns_bag
- | not (isEmptyBag errs_bag)
- = hPutStr stderr (pp_show (pprBagOfErrors pprErrorsStyle errs_bag))
- >> hPutStr stderr "\n" >>
- hPutStr stderr (pp_show (pprBagOfErrors pprErrorsStyle warns_bag))
- >> hPutStr stderr "\n" >>
- ghcExit 1
-
- | not (isEmptyBag warns_bag)
- = hPutStr stderr (pp_show (pprBagOfErrors pprErrorsStyle warns_bag)) >>
- hPutStr stderr "\n"
-
- | otherwise = return ()
-