Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : ghc-new-co

http://hackage.haskell.org/trac/ghc/changeset/224ef3094189bc9a33f23285b5dccbffdd8d7de0

>---------------------------------------------------------------

commit 224ef3094189bc9a33f23285b5dccbffdd8d7de0
Merge: fdf8656... d1bffa6...
Author: Simon Peyton Jones <[email protected]>
Date:   Sat Apr 30 14:26:48 2011 +0100

    Merge remote branch 'origin/master' into ghc-new-co
    
    Conflicts:
        compiler/typecheck/TcErrors.lhs
        compiler/typecheck/TcSMonad.lhs
        compiler/typecheck/TcType.lhs
        compiler/types/TypeRep.lhs

 .gitignore                                         |   22 +-
 HACKING                                            |    7 +-
 MAKEHELP                                           |    6 -
 aclocal.m4                                         |  114 +++----
 boot                                               |  233 +++++++++++--
 boot-pkgs                                          |  114 -------
 compiler/Makefile.local                            |   75 -----
 compiler/basicTypes/Module.lhs                     |   11 +-
 compiler/basicTypes/Name.lhs                       |    3 +-
 compiler/basicTypes/NameSet.lhs                    |   12 +-
 compiler/basicTypes/OccName.lhs                    |    3 +-
 compiler/basicTypes/SrcLoc.lhs                     |    8 +-
 compiler/basicTypes/Var.lhs                        |    3 +-
 compiler/cmm/CLabel.hs                             |   12 +-
 compiler/cmm/Cmm.hs                                |   21 +-
 compiler/cmm/CmmCPS.hs                             |    5 +-
 compiler/cmm/CmmExpr.hs                            |    6 +-
 compiler/cmm/CmmLint.hs                            |   16 +-
 compiler/cmm/CmmParse.y                            |   28 ++-
 compiler/cmm/CmmProcPoint.hs                       |    2 +
 compiler/cmm/CmmStackLayout.hs                     |  152 +++++++--
 compiler/cmm/MkGraph.hs                            |    2 +-
 compiler/cmm/OptimizationFuel.hs                   |   14 -
 compiler/cmm/PprC.hs                               |    2 +-
 compiler/cmm/cmm-notes                             |   29 +-
 compiler/codeGen/CodeGen.lhs                       |    2 +-
 compiler/codeGen/StgCmm.hs                         |    3 +-
 compiler/deSugar/Coverage.lhs                      |   16 +-
 compiler/ghc.mk                                    |    6 -
 compiler/ghci/RtClosureInspect.hs                  |    8 +-
 compiler/hsSyn/HsBinds.lhs                         |    8 +-
 compiler/hsSyn/HsDecls.lhs                         |   30 +-
 compiler/hsSyn/HsImpExp.lhs                        |   11 +-
 compiler/iface/MkIface.lhs                         |   34 +-
 compiler/llvmGen/LlvmCodeGen/Regs.hs               |    2 +
 compiler/main/DriverMkDepend.hs                    |    2 -
 compiler/main/DriverPipeline.hs                    |  111 +++----
 compiler/main/DynFlags.hs                          |  352 +++++++++++---------
 compiler/main/GHC.hs                               |    4 +-
 compiler/main/GhcMake.hs                           |    9 +-
 compiler/main/HscMain.lhs                          |   11 +-
 compiler/main/HscTypes.lhs                         |    2 +-
 compiler/main/Packages.lhs                         |    2 +-
 compiler/main/StaticFlagParser.hs                  |    1 -
 compiler/main/StaticFlags.hs                       |   18 +-
 compiler/main/SysTools.lhs                         |  115 ++++---
 compiler/nativeGen/AsmCodeGen.lhs                  |   19 +-
 compiler/nativeGen/PPC/CodeGen.hs                  |   37 +-
 compiler/nativeGen/PPC/Instr.hs                    |   10 +-
 compiler/nativeGen/PPC/Ppr.hs                      |    2 +-
 .../nativeGen/RegAlloc/Linear/JoinToTargets.hs     |    2 +-
 compiler/nativeGen/SPARC/CodeGen.hs                |   16 +-
 compiler/nativeGen/SPARC/Instr.hs                  |   10 +-
 compiler/nativeGen/SPARC/Ppr.hs                    |    2 +-
 compiler/nativeGen/X86/CodeGen.hs                  |   40 ++-
 compiler/nativeGen/X86/Instr.hs                    |   15 +-
 compiler/nativeGen/X86/Ppr.hs                      |   12 +-
 compiler/parser/Lexer.x                            |   42 ++--
 compiler/prelude/PrelRules.lhs                     |    2 +-
 compiler/prelude/primops.txt.pp                    |   14 +-
 compiler/rename/RnBinds.lhs                        |    7 +-
 compiler/rename/RnEnv.lhs                          |   13 +-
 compiler/rename/RnExpr.lhs                         |   11 +-
 compiler/rename/RnSource.lhs                       |    2 +-
 compiler/simplCore/CoreMonad.lhs                   |   14 +-
 compiler/simplCore/Simplify.lhs                    |    8 +-
 compiler/typecheck/TcBinds.lhs                     |   22 +-
 compiler/typecheck/TcDeriv.lhs                     |   12 +-
 compiler/typecheck/TcErrors.lhs                    |   90 +++---
 compiler/typecheck/TcForeign.lhs                   |  137 ++++----
 compiler/typecheck/TcGenDeriv.lhs                  |   31 +-
 compiler/typecheck/TcInteract.lhs                  |    9 +-
 compiler/typecheck/TcMType.lhs                     |   47 ++--
 compiler/typecheck/TcRnTypes.lhs                   |    6 +-
 compiler/typecheck/TcSMonad.lhs                    |   42 ++-
 compiler/typecheck/TcSimplify.lhs                  |   24 +-
 compiler/typecheck/TcType.lhs                      |   24 +-
 compiler/typecheck/TcUnify.lhs                     |    4 +-
 compiler/types/TypeRep.lhs                         |   57 +++-
 compiler/utils/Bag.lhs                             |    3 +-
 compiler/utils/GraphOps.hs                         |   15 +-
 compiler/utils/Outputable.lhs                      |    5 +-
 compiler/utils/UniqFM.lhs                          |   23 ++-
 compiler/utils/Util.lhs                            |   14 +
 configure.ac                                       |   25 +-
 distrib/Makefile                                   |    2 +-
 distrib/configure.ac.in                            |    4 +-
 docs/users_guide/debugging.xml                     |  132 ++++++--
 docs/users_guide/flags.xml                         |   59 +++-
 docs/users_guide/glasgow_exts.xml                  |    2 +-
 docs/users_guide/shared_libs.xml                   |    2 +-
 docs/users_guide/using.xml                         |   14 +
 extra-gcc-opts.in                                  |    1 -
 ghc.mk                                             |   13 +-
 ghc/Main.hs                                        |   42 ++-
 ghc/ghc-bin.cabal.in                               |    2 +-
 ghc/ghc.mk                                         |   28 +-
 ghc/ghc.wrapper                                    |    2 +-
 libffi/ghc.mk                                      |   11 +-
 libraries/Makefile.common                          |  118 -------
 libraries/Makefile.inc                             |    8 -
 libraries/Makefile.local                           |   38 ---
 libraries/tarballs/time-1.2.0.3.tar.gz             |  Bin 85069 -> 0 bytes
 libraries/tarballs/time-1.2.0.4.tar.gz             |  Bin 0 -> 85693 bytes
 mk/config.mk.in                                    |   42 ++-
 rts/Hash.c                                         |   67 ++--
 rts/Linker.c                                       |   26 +-
 rts/Stats.c                                        |   23 +-
 rts/ghc.mk                                         |    9 +-
 rts/sm/GC.c                                        |   13 +-
 rts/sm/Sanity.c                                    |    4 +
 rts/sm/Storage.c                                   |   25 ++-
 rules/build-package-data.mk                        |    7 +-
 rules/build-package-way.mk                         |    6 +-
 rules/build-package.mk                             |   16 +-
 rules/build-prog.mk                                |   18 +-
 rules/c-suffix-rules.mk                            |   10 +-
 rules/dependencies.mk                              |   38 +++
 rules/distdir-way-opts.mk                          |    8 +-
 rules/hs-suffix-rules-srcdir.mk                    |    4 +-
 rules/package-config.mk                            |    6 +
 rules/shell-wrapper.mk                             |    1 -
 settings.in                                        |    8 +
 sync-all                                           |  266 ++++++++-------
 utils/ghc-cabal/Main.hs                            |    3 +-
 utils/ghctags/Main.hs                              |    3 +-
 validate                                           |    2 +-
 127 files changed, 1975 insertions(+), 1623 deletions(-)

diff --cc compiler/typecheck/TcDeriv.lhs
index 195eb99,1798be3..72b99c5
--- a/compiler/typecheck/TcDeriv.lhs
+++ b/compiler/typecheck/TcDeriv.lhs
@@@ -1294,10 -1294,10 +1294,10 @@@ inferInstanceContexts oflag infer_spec
                  
           ; let tv_set = mkVarSet tyvars
                 weird_preds = [pred | pred <- deriv_rhs
 -                                     , not (tyVarsOfPred pred `subVarSet` 
tv_set)]  
 +                                     , not (tyVarsOfPred pred `subVarSet` 
tv_set)]
           ; mapM_ (addErrTc . badDerivedPred) weird_preds      
  
-            ; theta <- simplifyDeriv orig tyvars deriv_rhs
+            ; theta <- simplifyDeriv orig the_pred tyvars deriv_rhs
                -- checkValidInstance tyvars theta clas inst_tys
                -- Not necessary; see Note [Exotic derived instance contexts]
                --                in TcSimplify
diff --cc compiler/typecheck/TcErrors.lhs
index 9cbd47b,645c43a..0d0a9f8
--- a/compiler/typecheck/TcErrors.lhs
+++ b/compiler/typecheck/TcErrors.lhs
@@@ -15,8 -15,11 +15,9 @@@ import TcMTyp
  import TcSMonad
  import TcType
  import TypeRep
+ import Type( isTyVarTy )
 -
  import Inst
  import InstEnv
 -
  import TyCon
  import Name
  import NameEnv
diff --cc compiler/typecheck/TcType.lhs
index f2b090b,d9166d1..5d0bf48
--- a/compiler/typecheck/TcType.lhs
+++ b/compiler/typecheck/TcType.lhs
@@@ -397,12 -390,12 +395,12 @@@ kind_var_occ = mkOccName tvName "k
  \begin{code}
  pprTcTyVarDetails :: TcTyVarDetails -> SDoc
  -- For debugging
- pprTcTyVarDetails (SkolemTv _)         = ptext (sLit "sk")
- pprTcTyVarDetails (RuntimeUnk {})      = ptext (sLit "rt")
- pprTcTyVarDetails (FlatSkol {})        = ptext (sLit "fsk")
- pprTcTyVarDetails (MetaTv TauTv _)     = ptext (sLit "tau")
- pprTcTyVarDetails (MetaTv TcsTv _)     = ptext (sLit "tcs")
- pprTcTyVarDetails (MetaTv (SigTv _) _) = ptext (sLit "sig")
 -pprTcTyVarDetails (SkolemTv {})    = ptext (sLit "sk")
++pprTcTyVarDetails (SkolemTv {})     = ptext (sLit "sk")
+ pprTcTyVarDetails (RuntimeUnk {})  = ptext (sLit "rt")
+ pprTcTyVarDetails (FlatSkol {})    = ptext (sLit "fsk")
+ pprTcTyVarDetails (MetaTv TauTv _) = ptext (sLit "tau")
+ pprTcTyVarDetails (MetaTv TcsTv _) = ptext (sLit "tcs")
+ pprTcTyVarDetails (MetaTv SigTv _) = ptext (sLit "sig")
  
  pprUserTypeCtxt :: UserTypeCtxt -> SDoc
  pprUserTypeCtxt (FunSigCtxt n)  = ptext (sLit "the type signature for") <+> 
quotes (ppr n)
diff --cc compiler/types/TypeRep.lhs
index 446341d,7fdf4ae..87ffacd
--- a/compiler/types/TypeRep.lhs
+++ b/compiler/types/TypeRep.lhs
@@@ -566,13 -480,15 +566,11 @@@ instance Outputable name => OutputableB
  ------------------
        -- OK, here's the main printer
  
 -pprKind, pprParendKind :: Kind -> SDoc
 -pprKind = pprType
 -pprParendKind = pprParendType
 -
  ppr_type :: Prec -> Type -> SDoc
- ppr_type _ (TyVarTy tv)         -- Note [Infix type variables]
-   | isSymOcc (getOccName tv)  = parens (ppr tv)
-   | otherwise               = ppr tv
+ ppr_type _ (TyVarTy tv)             = ppr_tvar tv
  ppr_type p (PredTy pred)      = maybeParen p TyConPrec $
 -                                ifPprDebug (ptext (sLit "<pred>")) <> (ppr 
pred)
 -ppr_type p (TyConApp tc tys)  = ppr_tc_app p tc tys
 +                                ifPprDebug (ptext (sLit "<pred>")) <> 
(pprPredTy pred)
 +ppr_type p (TyConApp tc tys)  = pprTcApp p ppr_type tc tys
  
  ppr_type p (AppTy t1 t2) = maybeParen p TyConPrec $
                           pprType t1 <+> ppr_type TyConPrec t2
@@@ -599,23 -515,74 +597,68 @@@ ppr_forall_type p t
      (tvs,  rho) = split1 [] ty
      (ctxt, tau) = split2 [] rho
  
 -    -- We need to be extra careful here as equality constraints will occur as
 -    -- type variables with an equality kind.  So, while collecting quantified
 -    -- variables, we separate the coercion variables out and turn them into
 -    -- equality predicates.
 -    split1 tvs (ForAllTy tv ty) 
 -      | not (isCoVar tv)     = split1 (tv:tvs) ty
 -    split1 tvs ty          = (reverse tvs, ty)
 +    split1 tvs (ForAllTy tv ty) = split1 (tv:tvs) ty
 +    split1 tvs ty             = (reverse tvs, ty)
   
      split2 ps (PredTy p `FunTy` ty) = split2 (p:ps) ty
 -    split2 ps (ForAllTy tv ty) 
 -      | isCoVar tv                = split2 (coVarPred tv : ps) ty
      split2 ps ty                  = (reverse ps, ty)
  
+ ppr_tc_app :: Prec -> TyCon -> [Type] -> SDoc
+ ppr_tc_app _ tc []
+   = ppr_tc tc
+ ppr_tc_app _ tc [ty]
+   | tc `hasKey` listTyConKey = brackets (pprType ty)
+   | tc `hasKey` parrTyConKey = ptext (sLit "[:") <> pprType ty <> ptext (sLit 
":]")
+   | tc `hasKey` liftedTypeKindTyConKey   = ptext (sLit "*")
+   | tc `hasKey` unliftedTypeKindTyConKey = ptext (sLit "#")
+   | tc `hasKey` openTypeKindTyConKey     = ptext (sLit "(?)")
+   | tc `hasKey` ubxTupleKindTyConKey     = ptext (sLit "(#)")
+   | tc `hasKey` argTypeKindTyConKey      = ptext (sLit "??")
+ 
+ ppr_tc_app p tc tys
+   | isTupleTyCon tc && tyConArity tc == length tys
+   = tupleParens (tupleTyConBoxity tc) (sep (punctuate comma (map pprType 
tys)))
+   | otherwise
+   = ppr_type_app p (getName tc) tys
+ 
+ ppr_type_app :: Prec -> Name -> [Type] -> SDoc
+ -- Used for classes as well as types; that's why it's separate from ppr_tc_app
+ ppr_type_app p tc tys
+   | is_sym_occ                -- Print infix if possible
+   , [ty1,ty2] <- tys  -- We know nothing of precedence though
+   = maybeParen p FunPrec (sep [ppr_type FunPrec ty1, 
+                              pprInfixVar True (ppr tc) <+> ppr_type FunPrec 
ty2])
+   | otherwise
+   = maybeParen p TyConPrec (hang (pprPrefixVar is_sym_occ (ppr tc))
+                              2 (sep (map pprParendType tys)))
+   where
+     is_sym_occ = isSymOcc (getOccName tc)
+ 
+ ppr_tc :: TyCon -> SDoc       -- No brackets for SymOcc
+ ppr_tc tc 
+   = pp_nt_debug <> ppr tc
+   where
+    pp_nt_debug | isNewTyCon tc = ifPprDebug (if isRecursiveTyCon tc 
+                                            then ptext (sLit "<recnt>")
+                                            else ptext (sLit "<nt>"))
+              | otherwise     = empty
+ 
+ ppr_tvar :: TyVar -> SDoc
+ ppr_tvar tv  -- Note [Infix type variables]
+   | isSymOcc (getOccName tv)  = parens (ppr tv)
+   | otherwise               = ppr tv
+ 
  -------------------
  pprForAll :: [TyVar] -> SDoc
  pprForAll []  = empty
  pprForAll tvs = ptext (sLit "forall") <+> sep (map pprTvBndr tvs) <> dot
  
  pprTvBndr :: TyVar -> SDoc
- pprTvBndr tv
-   | isLiftedTypeKind kind = ppr tv
-   | otherwise             = parens (ppr tv <+> dcolon <+> pprKind kind)
-   where
-     kind = tyVarKind tv
 -pprTvBndr tv | isLiftedTypeKind kind = ppr_tvar tv
 -           | otherwise             = parens (ppr_tvar tv <+> dcolon <+> 
pprKind kind)
++pprTvBndr tv 
++  | isLiftedTypeKind kind = ppr_tvar tv
++  | otherwise           = parens (ppr_tvar tv <+> dcolon <+> pprKind kind)
+            where
+              kind = tyVarKind tv
  \end{code}
  
  Note [Infix type variables]



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to