)
import RnEnv
-import DynFlags ( DynFlag(..) )
+import DynFlags
import Name
import NameEnv
import NameSet
-> HsValBinds RdrName
-> RnM (HsValBindsLR Name RdrName)
rnTopBindsLHS fix_env binds
- = do { mod <- getModule
- ; rnValBindsLHSFromDoc (topRecNameMaker mod fix_env) binds }
+ = rnValBindsLHSFromDoc (topRecNameMaker fix_env) binds
rnTopBindsRHS :: NameSet -- Names bound by these binds
-> HsValBindsLR Name RdrName
; let
-- The variables "used" in the val binds are:
- -- (1) the uses of the binds (duUses)
+ -- (1) the uses of the binds (allUses)
-- (2) the FVs of the thing-inside
- all_uses = duUses dus `plusFV` result_fvs
+ all_uses = allUses dus `plusFV` result_fvs
-- Note [Unused binding hack]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~
-- Note that *in contrast* to the above reporting of
-> RnM (LHsBinds Name, FreeVars)
rnMethodBinds cls sig_fn gen_tyvars binds
- = foldM do_one (emptyBag,emptyFVs) (bagToList binds)
- where do_one (binds,fvs) bind = do
- (bind', fvs_bind) <- rnMethodBind cls sig_fn gen_tyvars bind
- return (bind' `unionBags` binds, fvs_bind `plusFV` fvs)
+ = foldlM do_one (emptyBag,emptyFVs) (bagToList binds)
+ where
+ do_one (binds,fvs) bind
+ = do { (bind', fvs_bind) <- rnMethodBind cls sig_fn gen_tyvars bind
+ ; return (binds `unionBags` bind', fvs_bind `plusFV` fvs) }
rnMethodBind :: Name
-> (Name -> [Name])