- dflags = hsc_dflags hsc_env
- hpt = hsc_HPT hsc_env
- pte = eps_PTE (pcs_EPS pcs)
- lookup n = pprTrace "lookup" (ppr type_env) (
- lookupNameEnv type_env n `orElse` -- Look in the type env of the
- -- current module first
- lookupType hpt pte n `orElse` -- Then other modules
- pprPanic "Desugar: lookup:" (ppr n)
- )
-
- mk_warn :: (SrcLoc,SDoc) -> (SrcLoc, Pretty.Doc)
- mk_warn (loc,sdoc) = addShortWarnLocLine loc print_unqual sdoc
-
- print_unqual = unQualInScope rdr_env
-
-dsProgram all_binds rules fo_decls
- = dsMonoBinds auto_scc all_binds [] `thenDs` \ core_prs ->
- dsForeigns fo_decls `thenDs` \ (ds_fords, foreign_binds) ->
- let
- ds_binds = [Rec (foreign_binds ++ core_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#!