- Bindings
-%* *
-%*********************************************************
-
-These chaps are here, rather than in TcBinds, so that there
-is just one hi-boot file (for RnSource). rnSrcDecls is part
-of the loop too, and it must be defined in this module.
-
-\begin{code}
-rnBindGroups :: [HsBindGroup RdrName] -> RnM ([HsBindGroup Name], DefUses)
--- This version assumes that the binders are already in scope
--- It's used only in 'mdo'
-rnBindGroups []
- = returnM ([], emptyDUs)
-rnBindGroups [HsBindGroup bind sigs _]
- = rnBinds NotTopLevel bind sigs
-rnBindGroups b@[HsIPBinds bind]
- = do addErr (badIpBinds b)
- returnM ([], emptyDUs)
-rnBindGroups _
- = panic "rnBindGroups"
-
-rnBindGroupsAndThen
- :: [HsBindGroup RdrName]
- -> ([HsBindGroup Name] -> RnM (result, FreeVars))
- -> RnM (result, FreeVars)
--- This version (a) assumes that the binding vars are not already in scope
--- (b) removes the binders from the free vars of the thing inside
--- The parser doesn't produce ThenBinds
-rnBindGroupsAndThen [] thing_inside
- = thing_inside []
-rnBindGroupsAndThen [HsBindGroup bind sigs _] thing_inside
- = rnBindsAndThen bind sigs $ \ groups -> thing_inside groups
-rnBindGroupsAndThen [HsIPBinds binds] thing_inside
- = rnIPBinds binds `thenM` \ (binds',fv_binds) ->
- thing_inside [HsIPBinds binds'] `thenM` \ (thing, fvs_thing) ->
- returnM (thing, fvs_thing `plusFV` fv_binds)
-
-rnIPBinds [] = returnM ([], emptyFVs)
-rnIPBinds (bind : binds)
- = wrapLocFstM rnIPBind bind `thenM` \ (bind', fvBind) ->
- rnIPBinds binds `thenM` \ (binds',fvBinds) ->
- returnM (bind' : binds', fvBind `plusFV` fvBinds)
-
-rnIPBind (IPBind n expr)
- = newIPNameRn n `thenM` \ name ->
- rnLExpr expr `thenM` \ (expr',fvExpr) ->
- return (IPBind name expr', fvExpr)
-
-badIpBinds binds
- = hang (ptext SLIT("Implicit-parameter bindings illegal in 'mdo':")) 4
- (ppr binds)
-\end{code}
-
-
-%*********************************************************
-%* *