diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-03-26 08:23:34 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-03-26 08:23:34 +0100 |
commit | e5beffb7c34aa2cb0df2f3b04fd18f664eccdcc7 (patch) | |
tree | 4191b5ac75f81bee12c403196cbf5096177ebd0a /compiler | |
parent | d9ee9d9d964c5cc4bc40c2a62d825e4b33548860 (diff) | |
download | haskell-e5beffb7c34aa2cb0df2f3b04fd18f664eccdcc7.tar.gz |
Complete refactoring of HsDecls/HsTyDefn
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/main/HscStats.hs | 12 | ||||
-rw-r--r-- | compiler/rename/RnTypes.lhs | 3 |
2 files changed, 7 insertions, 8 deletions
diff --git a/compiler/main/HscStats.hs b/compiler/main/HscStats.hs index ff09454b12..ea3739a88e 100644 --- a/compiler/main/HscStats.hs +++ b/compiler/main/HscStats.hs @@ -122,7 +122,7 @@ ppSourceStats short (L _ (HsModule _ exports imports ldecls _ _)) spec_info (Just (False, _)) = (0,0,0,0,0,1,0) spec_info (Just (True, _)) = (0,0,0,0,0,0,1) - data_info (TyData {tcdCons = cs, tcdDerivs = derivs}) + data_info (TyDecl { tcdTyDefn = TyData {td_cons = cs, td_derivs = derivs}}) = (length cs, case derivs of Nothing -> 0 Just ds -> length ds) data_info _ = (0,0) @@ -133,9 +133,9 @@ ppSourceStats short (L _ (HsModule _ exports imports ldecls _ _)) (classops, addpr (foldr add2 (0,0) (map (count_bind.unLoc) (bagToList (tcdMeths decl))))) class_info _ = (0,0) - inst_info (FamInstDecl d) = case countATDecl d of + inst_info (FamInstD d) = case countATDecl d of (tyd, dtd) -> (0,0,0,tyd,dtd) - inst_info (ClsInstDecl _ inst_meths inst_sigs ats) + inst_info (ClsInstD _ inst_meths inst_sigs ats) = case count_sigs (map unLoc inst_sigs) of (_,_,ss,is,_) -> case foldr add2 (0, 0) (map (countATDecl . unLoc) ats) of @@ -144,10 +144,8 @@ ppSourceStats short (L _ (HsModule _ exports imports ldecls _ _)) (map (count_bind.unLoc) (bagToList inst_meths))), ss, is, tyDecl, dtDecl) where - countATDecl (TyData {}) = (0, 1) - countATDecl (TySynonym {}) = (1, 0) - countATDecl d = pprPanic "countATDecl: Unhandled decl" - (ppr d) + countATDecl (FamInstDecl { fid_defn = TyData {} }) = (0, 1) + countATDecl (FamInstDecl { fid_defn = TySynonym {} }) = (1, 0) addpr :: (Int,Int) -> Int add2 :: (Int,Int) -> (Int,Int) -> (Int, Int) diff --git a/compiler/rename/RnTypes.lhs b/compiler/rename/RnTypes.lhs index 0f994ec883..6e89b12041 100644 --- a/compiler/rename/RnTypes.lhs +++ b/compiler/rename/RnTypes.lhs @@ -121,12 +121,13 @@ rnHsKind = rnHsTyKi False rnHsTyKi :: Bool -> HsDocContext -> HsType RdrName -> RnM (HsType Name, FreeVars) -rnHsTyKi isType doc (HsForAllTy Implicit _ lctxt@(L loc ctxt) ty) +rnHsTyKi isType doc (HsForAllTy Implicit _ lctxt@(L _ ctxt) ty) = ASSERT ( isType ) do -- Implicit quantifiction in source code (no kinds on tyvars) -- Given the signature C => T we universally quantify -- over FV(T) \ {in-scope-tyvars} name_env <- getLocalRdrEnv + loc <- getSrcSpanM let mentioned = extractHsTysRdrTyVars (ty:ctxt) |