+\begin{code}
+tidyVectInfo :: TidyEnv -> VectInfo -> VectInfo
+tidyVectInfo (_, var_env) info@(VectInfo { vectInfoVar = vars
+ , vectInfoPADFun = pas
+ , vectInfoIso = isos })
+ = info { vectInfoVar = tidy_vars
+ , vectInfoPADFun = tidy_pas
+ , vectInfoIso = tidy_isos }
+ where
+ tidy_vars = mkVarEnv
+ $ map tidy_var_mapping
+ $ varEnvElts vars
+
+ tidy_pas = mapNameEnv tidy_snd_var pas
+ tidy_isos = mapNameEnv tidy_snd_var isos
+
+ tidy_var_mapping (from, to) = (from', (from', lookup_var to))
+ where from' = lookup_var from
+ tidy_snd_var (x, var) = (x, lookup_var var)
+
+ lookup_var var = lookupWithDefaultVarEnv var_env var var
+\end{code}
+