extendInteractiveContextWithIds :: InteractiveContext -> [Id] -> InteractiveContext
extendInteractiveContextWithIds ictxt ids
  | null ids  = ictxt
  | otherwise = ictxt { ic_mod_index  = ic_mod_index ictxt + 1
                      , ic_tythings   = new_tythings ++ old_tythings
                      , ic_rn_gbl_env = ic_rn_gbl_env ictxt `icExtendGblRdrEnv` new_tythings }
  where
    new_tythings = map AnId ids
    old_tythings = filterOut (shadowed_by ids) (ic_tythings ictxt)
extendInteractiveContextWithIds :: InteractiveContext -> [Id] -> InteractiveContext
extendInteractiveContextWithIds ictxt ids
  | null ids  = ictxt
  | otherwise = ictxt { ic_mod_index  = ic_mod_index ictxt + 1
                      , ic_tythings   = new_tythings ++ old_tythings
                      , ic_rn_gbl_env = ic_rn_gbl_env ictxt `icExtendGblRdrEnv` new_tythings }
  where
    new_tythings = map AnId ids
    old_tythings = filterOut (shadowed_by ids) (ic_tythings ictxt)
extendInteractiveContextWithIds ictxt ids
  | null ids  = ictxt
  | otherwise = ictxt { ic_mod_index  = ic_mod_index ictxt + 1
                      , ic_tythings   = new_tythings ++ old_tythings
                      , ic_rn_gbl_env = ic_rn_gbl_env ictxt `icExtendGblRdrEnv` new_tythings }
  where
    new_tythings = map AnId ids
    old_tythings = filterOut (shadowed_by ids) (ic_tythings ictxt)