+
+tcExtendGlobalTyVars extra_global_tvs scope
+ = tcGetEnv `thenNF_Tc` \ (TcEnv tve tce ce gve lve gtvs) ->
+ tcReadMutVar gtvs `thenNF_Tc` \ global_tvs ->
+ let
+ new_global_tyvars = global_tvs `unionTyVarSets` extra_global_tvs
+ in
+ tcNewMutVar new_global_tyvars `thenNF_Tc` \ gtvs' ->
+ tcSetEnv (TcEnv tve tce ce gve lve gtvs') scope