X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcTyDecls.lhs;h=de22c637080b2f7945703ad908429045e9de1a26;hb=3f1b316d7035c55cd712cd39a9981339bcef2e8c;hp=04602ac09b55fe4f3bf15328e5c441d051d3e687;hpb=49c98d143c382a1341e1046f5ca00819a25691ba;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcTyDecls.lhs b/compiler/typecheck/TcTyDecls.lhs index 04602ac..de22c63 100644 --- a/compiler/typecheck/TcTyDecls.lhs +++ b/compiler/typecheck/TcTyDecls.lhs @@ -8,8 +8,14 @@ Analysis functions over data types. Specficially, detecting recursive types. 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 @@ -25,8 +31,6 @@ import HscTypes import TyCon import Class import DataCon -import Var -import VarSet import Name import NameEnv import NameSet @@ -281,6 +285,7 @@ new_tc_rhs tc = snd (newTyConRhs tc) -- Ignore the type variables 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 @@ -313,6 +318,7 @@ tcTyConsOfType ty 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