-addImplicitFVs :: GlobalRdrEnv
- -> Maybe (ModuleName, [RenamedHsDecl]) -- Nothing when compling an expression
- -> FreeVars -- Free in the source
- -> RnMG (FreeVars, SyntaxMap) -- Augmented source free vars
-
-addImplicitFVs gbl_env maybe_mod source_fvs
- = -- Find out what re-bindable names to use for desugaring
- rnSyntaxNames gbl_env source_fvs `thenRn` \ (source_fvs1, sugar_map) ->
-
- -- Find implicit FVs thade
- extra_implicits maybe_mod `thenRn` \ extra_fvs ->
-
- let
- implicit_fvs = ubiquitousNames `plusFV` extra_fvs
- slurp_fvs = implicit_fvs `plusFV` source_fvs1
- -- It's important to do the "plus" this way round, so that
- -- when compiling the prelude, locally-defined (), Bool, etc
- -- override the implicit ones.
- in
- returnRn (slurp_fvs, sugar_map)
-
- where
- extra_implicits Nothing -- Compiling a statement
- = returnRn (mkFVs [printName, bindIOName, returnIOName, failIOName])
+getImplicitStmtFVs -- Compiling a statement
+ = returnRn (mkFVs [printName, bindIOName, returnIOName, failIOName]
+ `plusFV` ubiquitousNames)