+initEnv mut = TcEnv emptyUFM emptyUFM emptyUFM (emptyVarSet, mut)
+
+getEnvClasses (TcEnv _ te _ _) = [cl | (_, AClass cl _) <- eltsUFM te]
+
+getEnvTyCons (TcEnv _ te _ _) = catMaybes (map get_tc (eltsUFM te))
+ where
+ get_tc (_, ADataTyCon tc) = Just tc
+ get_tc (_, ASynTyCon tc _) = Just tc
+ get_tc other = Nothing
+
+getEnvAllTyCons te_list = catMaybes (map get_tc te_list)
+ -- The 'all' means 'including the tycons from class decls'
+ where
+ get_tc (_, ADataTyCon tc) = Just tc
+ get_tc (_, ASynTyCon tc _) = Just tc
+ get_tc (_, AClass cl _) = Just (classTyCon cl)
+ get_tc other = Nothing
+\end{code}