+
+placeHolderNames :: NameSet
+-- Used for the NameSet in FunBind and PatBind prior to the renamer
+placeHolderNames = panic "placeHolderNames"
+
+------------
+instance OutputableBndr id => Outputable (HsLocalBinds id) where
+ ppr (HsValBinds bs) = ppr bs
+ ppr (HsIPBinds bs) = ppr bs
+ ppr EmptyLocalBinds = empty
+
+instance OutputableBndr id => Outputable (HsValBinds id) where
+ ppr (ValBindsIn binds sigs)
+ = vcat [vcat (map ppr sigs),
+ vcat (map ppr (bagToList binds))
+ -- *not* pprLHsBinds because we don't want braces; 'let' and
+ -- 'where' include a list of HsBindGroups and we don't want
+ -- several groups of bindings each with braces around.
+ ]
+ ppr (ValBindsOut sccs) = vcat (map ppr_scc sccs)
+ where
+ ppr_scc (rec_flag, binds) = pp_rec rec_flag <+> pprLHsBinds binds
+ pp_rec Recursive = ptext SLIT("rec")
+ pp_rec NonRecursive = ptext SLIT("nonrec")
+
+pprLHsBinds :: OutputableBndr id => LHsBinds id -> SDoc
+pprLHsBinds binds
+ | isEmptyLHsBinds binds = empty
+ | otherwise = lbrace <+> vcat (map ppr (bagToList binds)) <+> rbrace
+
+------------
+emptyLocalBinds :: HsLocalBinds a
+emptyLocalBinds = EmptyLocalBinds
+
+isEmptyLocalBinds :: HsLocalBinds a -> Bool
+isEmptyLocalBinds (HsValBinds ds) = isEmptyValBinds ds
+isEmptyLocalBinds (HsIPBinds ds) = isEmptyIPBinds ds
+isEmptyLocalBinds EmptyLocalBinds = True
+
+isEmptyValBinds :: HsValBinds a -> Bool
+isEmptyValBinds (ValBindsIn ds sigs) = isEmptyLHsBinds ds && null sigs
+isEmptyValBinds (ValBindsOut ds) = null ds
+
+emptyValBindsIn, emptyValBindsOut :: HsValBinds a
+emptyValBindsIn = ValBindsIn emptyBag []
+emptyValBindsOut = ValBindsOut []
+
+emptyLHsBinds :: LHsBinds id
+emptyLHsBinds = emptyBag
+
+isEmptyLHsBinds :: LHsBinds id -> Bool
+isEmptyLHsBinds = isEmptyBag
+
+------------
+plusHsValBinds :: HsValBinds a -> HsValBinds a -> HsValBinds a
+plusHsValBinds (ValBindsIn ds1 sigs1) (ValBindsIn ds2 sigs2)
+ = ValBindsIn (ds1 `unionBags` ds2) (sigs1 ++ sigs2)
+plusHsValBinds (ValBindsOut ds1) (ValBindsOut ds2)
+ = ValBindsOut (ds1 ++ ds2)