import RnHsSyn
import TcRnMonad
import RnTypes ( rnHsSigType, rnLHsType, checkPrecMatch)
-import RnPat (rnPatsAndThen_LocalRightwards, rnBindPat,
+import RnPat (rnPats, rnBindPat,
NameMaker, localRecNameMaker, topRecNameMaker, applyNameMaker
)
rnTopBindsLHS :: MiniFixityEnv
-> HsValBinds RdrName
-> RnM (HsValBindsLR Name RdrName)
-rnTopBindsLHS fix_env binds =
- (uncurry $ rnValBindsLHSFromDoc (topRecNameMaker fix_env)) (bindersAndDoc binds) binds
+rnTopBindsLHS fix_env binds
+ = do { let (boundNames,doc) = bindersAndDoc binds
+ ; mod <- getModule
+ ; rnValBindsLHSFromDoc (topRecNameMaker mod fix_env) boundNames doc binds }
rnTopBindsRHS :: NameSet -- Names bound by these binds
-> HsValBindsLR Name RdrName
fun_tick = fun_tick
}))
= setSrcSpan loc $
- do { (newname, _fvs) <- applyNameMaker name_maker name $ \ newname ->
- return (newname, emptyFVs)
+ do { newname <- applyNameMaker name_maker name
; return (L loc (FunBind { fun_id = L nameLoc newname,
fun_infix = inf,
fun_matches = matches,
rnMethodBind cls sig_fn gen_tyvars (L loc (FunBind { fun_id = name, fun_infix = inf,
fun_matches = MatchGroup matches _ }))
= setSrcSpan loc $ do
- sel_name <- lookupInstDeclBndr cls name
+ sel_name <- wrapLocM (lookupInstDeclBndr cls) name
let plain_name = unLoc sel_name
-- We use the selector name as the binder
-- Now the main event
-- note that there are no local ficity decls for matches
- ; rnPatsAndThen_LocalRightwards ctxt pats $ \ pats' -> do
+ ; rnPats ctxt pats $ \ pats' -> do
{ (grhss', grhss_fvs) <- rnGRHSs ctxt grhss
; return (Match pats' Nothing grhss', grhss_fvs) }}