- print_unqual = unQualInScope rdr_env
-
- mk_warn :: (SrcSpan,SDoc) -> WarnMsg
- mk_warn (loc,sdoc) = mkWarnMsg loc print_unqual sdoc
-
-
-dsProgram ghci_mode (TcGblEnv { tcg_exports = exports,
- tcg_keep = keep_alive,
- tcg_binds = binds,
- tcg_fords = fords,
- tcg_rules = rules })
- = dsHsBinds auto_scc binds [] `thenDs` \ core_prs ->
- dsForeigns fords `thenDs` \ (ds_fords, foreign_prs) ->
- let
- all_prs = foreign_prs ++ core_prs
- local_bndrs = mkVarSet (map fst all_prs)
- in
- mappM (dsRule local_bndrs) rules `thenDs` \ ds_rules ->
- let
- final_prs = addExportFlags ghci_mode exports keep_alive
- local_bndrs all_prs ds_rules
- ds_binds = [Rec final_prs]
- -- Notice that we put the whole lot in a big Rec, even the foreign binds
- -- When compiling PrelFloat, which defines data Float = F# Float#
- -- we want F# to be in scope in the foreign marshalling code!
- -- You might think it doesn't matter, but the simplifier brings all top-level
- -- things into the in-scope set before simplifying; so we get no unfolding for F#!
- in
- returnDs (ds_binds, ds_rules, ds_fords)
- where
- auto_scc | opt_SccProfilingOn = TopLevel
- | otherwise = NoSccs