This stuff is only used for source-code decls; it's recorded in interface
files for imported data types.
-
\begin{code}
+{-# OPTIONS -w #-}
+-- The above warning supression flag is a temporary kludge.
+-- While working on this module you are encouraged to remove it and fix
+-- any warnings in the module. See
+-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
+-- for details
+
module TcTyDecls(
calcRecFlags,
calcClassCycles, calcSynCycles
import TyCon
import Class
import DataCon
-import Var
-import VarSet
import Name
import NameEnv
import NameSet
getTyCon (ATyCon tc) = tc
getTyCon (AClass cl) = classTyCon cl
+getTyCon other = panic "getTyCon"
findLoopBreakers :: [(TyCon, [TyCon])] -> [Name]
-- Finds a set of tycons that cut all loops
go (PredTy (IParam _ ty)) = go ty
go (PredTy (ClassP cls tys)) = go_tc (classTyCon cls) tys
go (ForAllTy _ ty) = go ty
+ go other = panic "tcTyConsOfType"
go_tc tc tys = extendNameEnv (go_s tys) (tyConName tc) tc
go_s tys = foldr (plusNameEnv . go) emptyNameEnv tys