Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/e5beffb7c34aa2cb0df2f3b04fd18f664eccdcc7 >--------------------------------------------------------------- commit e5beffb7c34aa2cb0df2f3b04fd18f664eccdcc7 Author: Simon Peyton Jones <[email protected]> Date: Mon Mar 26 08:23:34 2012 +0100 Complete refactoring of HsDecls/HsTyDefn >--------------------------------------------------------------- compiler/main/HscStats.hs | 12 +++++------- 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 ff09454..ea3739a 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 0f994ec..6e89b12 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) _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
