X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcTyDecls.lhs;h=956f944dfcb673e17e933c3fa8e072710c3ac2c2;hb=79011516105291b58324ce71a87f6bb26a131090;hp=c1a3389c9c9e522c03fbcdfda2245482e1dc6e29;hpb=ab22f4e6456820c1b5169d75f5975a94e61f54ce;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcTyDecls.lhs b/compiler/typecheck/TcTyDecls.lhs index c1a3389..956f944 100644 --- a/compiler/typecheck/TcTyDecls.lhs +++ b/compiler/typecheck/TcTyDecls.lhs @@ -9,6 +9,13 @@ 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 @@ -24,8 +31,6 @@ import HscTypes import TyCon import Class import DataCon -import Var -import VarSet import Name import NameEnv import NameSet @@ -94,7 +99,6 @@ synTyConsOfType ty go (FunTy a b) = go a `plusNameEnv` go b go (PredTy (IParam _ ty)) = go ty go (PredTy (ClassP cls tys)) = go_s tys -- Ignore class - go (NoteTy _ ty) = go ty go (ForAllTy _ ty) = go ty go_tc tc tys | isSynTyCon tc = extendNameEnv (go_s tys) (tyConName tc) tc @@ -280,6 +284,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 @@ -312,6 +317,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