- ; gbl_env <- addFamInsts (map ATyCon deriv_ty_insts) $
- tcExtendGlobalEnv (map ATyCon (deriv_tys ++ deriv_ty_insts)) $
- addInsts deriv_inst_info getGblEnv
+ ; let all_tycons = map ATyCon (deriv_tys ++ deriv_ty_insts)
+ ; gbl_env <- tcExtendGlobalEnv all_tycons $
+ tcExtendGlobalEnv (concatMap implicitTyThings all_tycons) $
+ addFamInsts deriv_ty_insts $
+ addInsts deriv_inst_info getGblEnv