--- exitMn 0
-{- LATER ... -}
-
- -- ******* TYPECHECKER
- show_pass "TypeCheck" `thenMn_`
- let
- rn_info = trace "Main.rn_info" (\ x -> Nothing, \ x -> Nothing)
- in
- case (case (typecheckModule tc_uniqs {-idinfo_fm-} rn_info 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
- writeMn stderr (ppShow pprCols (pprBagOfErrors pprErrorsStyle tc_errs_bag))
- `thenMn_` writeMn stderr "\n" `thenMn_`
- writeMn stderr (ppShow pprCols (pprBagOfErrors pprErrorsStyle tc_warns_bag))
- `thenMn_` writeMn stderr "\n" `thenMn_`
- exitMn 1
-
- else ( -- No typechecking errors ...
-
- (if (isEmptyBag tc_warns_bag) then
- returnMn ()
- else
- writeMn stderr (ppShow pprCols (pprBagOfErrors pprErrorsStyle tc_warns_bag))
- `thenMn_` writeMn stderr "\n"
- ) `thenMn_`
-
- case tc_results
- of { (typechecked_quint@(recsel_binds, class_binds, inst_binds, val_binds, const_binds),
- interface_stuff@(_,_,_,_,_), -- @-pat just for strictness...
- (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])) `thenMn_`
-
- doDump opt_D_dump_deriv "Derived instances:"
- (pp_show (ddump_deriv pprStyle)) `thenMn_`