- case (case (typecheckModule tc_uniqs {-idinfo_fm-} rn_env rn_mod) of
- Succeeded (stuff, warns)
- -> (emptyBag, warns, stuff)
- Failed (errs, warns)
- -> (errs, warns, error "tc_results"))
-
- of { (tc_errs_bag, tc_warns_bag, tc_results) ->
-
- if (not (isEmptyBag tc_errs_bag)) then
- hPutStr stderr (ppShow pprCols (pprBagOfErrors pprErrorsStyle tc_errs_bag))
- >> hPutStr stderr "\n" >>
- hPutStr stderr (ppShow pprCols (pprBagOfErrors pprErrorsStyle tc_warns_bag))
- >> hPutStr stderr "\n" >>
- ghcExit 1
-
- else ( -- No typechecking errors ...
-
- (if (isEmptyBag tc_warns_bag) then
- return ()
- else
- hPutStr stderr (ppShow pprCols (pprBagOfErrors pprErrorsStyle tc_warns_bag))
- >> hPutStr stderr "\n"
- ) >>
-
- case tc_results
- of { (typechecked_quint@(recsel_binds, class_binds, inst_binds, val_binds, const_binds),
- interface_stuff,
- (local_tycons,local_classes), pragma_tycon_specs, ddump_deriv) ->
-
- doDump opt_D_dump_tc "Typechecked:"
- (pp_show (ppAboves [
- ppr pprStyle recsel_binds,
- ppr pprStyle class_binds,
- ppr pprStyle inst_binds,
- ppAboves (map (\ (i,e) -> ppr pprStyle (VarMonoBind i e)) const_binds),
- ppr pprStyle val_binds])) >>
-
- doDump opt_D_dump_deriv "Derived instances:"
- (pp_show (ddump_deriv pprStyle)) >>
-
- -- OK, now do the interface stuff that relies on typechecker output:
- ifaceDecls if_handle interface_stuff >>
- ifaceInstances if_handle interface_stuff >>