-- ToDo: should not add Ids to the gbl env here

-- | Add TyThings to the GlobalRdrEnv, earlier ones in the list shadowing
-- later ones, and shadowing existing entries in the GlobalRdrEnv.
icExtendGblRdrEnv :: GlobalRdrEnv -> [TyThing] -> GlobalRdrEnv
icExtendGblRdrEnv env tythings
  = foldr add env tythings  -- Foldr makes things in the front of
                            -- the list shadow things at the back
  where
    add thing env = extendGlobalRdrEnv True {- Shadowing please -} env
                                       [tyThingAvailInfo thing]
       -- One at a time, to ensure each shadows the previous ones
icExtendGblRdrEnv :: GlobalRdrEnv -> [TyThing] -> GlobalRdrEnv
icExtendGblRdrEnv env tythings
  = foldr add env tythings  -- Foldr makes things in the front of
                            -- the list shadow things at the back
  where
    add thing env = extendGlobalRdrEnv True {- Shadowing please -} env
                                       [tyThingAvailInfo thing]
       -- One at a time, to ensure each shadows the previous ones
icExtendGblRdrEnv env tythings
  = foldr add env tythings  -- Foldr makes things in the front of
                            -- the list shadow things at the back
  where
    add thing env = extendGlobalRdrEnv True {- Shadowing please -} env
                                       [tyThingAvailInfo thing]
       -- One at a time, to ensure each shadows the previous ones