Use smart lookup for tycons
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>
Wed, 20 Sep 2006 18:49:34 +0000 (18:49 +0000)
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>
Wed, 20 Sep 2006 18:49:34 +0000 (18:49 +0000)
Mon Sep 18 19:49:35 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
  * Use smart lookup for tycons
  Tue Sep 12 12:55:10 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
    * Use smart lookup for tycons

compiler/typecheck/TcTyClsDecls.lhs

index 737cd63..0c0c93a 100644 (file)
@@ -27,7 +27,8 @@ import TcEnv          ( TyThing(..),
                          tcLookupLocated, tcLookupLocatedGlobal, 
                          tcExtendGlobalEnv, tcExtendKindEnv,
                          tcExtendKindEnvTvs, newFamInstTyConName,
-                         tcExtendRecEnv, tcLookupTyVar, InstInfo )
+                         tcExtendRecEnv, tcLookupTyVar, InstInfo,
+                         tcLookupLocatedTyCon )
 import TcTyDecls       ( calcRecFlags, calcClassCycles, calcSynCycles )
 import TcClassDcl      ( tcClassSigs, tcAddDeclCtxt )
 import TcHsType                ( kcHsTyVars, kcHsLiftedSigType, kcHsType, 
@@ -371,10 +372,8 @@ kcIdxTyPats :: TyClDecl Name
            -> TcM a
 kcIdxTyPats decl thing_inside
   = kcHsTyVars (tcdTyVars decl) $ \tvs -> 
-    do { tc_ty_thing <- tcLookupLocated (tcdLName decl)
-       ; let { family = case tc_ty_thing of 
-                         AGlobal (ATyCon family) -> family
-             ; (kinds, resKind) = splitKindFunTys (tyConKind family)
+    do { family <- tcLookupLocatedTyCon (tcdLName decl)
+       ; let { (kinds, resKind) = splitKindFunTys (tyConKind family)
             ; hs_typats        = fromJust $ tcdTyPats decl }
 
          -- we may not have more parameters than the kind indicates