cvs commit: fptools/ghc/compiler/codeGen ClosureInfo.lhs fptools/ghc/compiler/iface BuildTyCl.lhs IfaceSyn.lhs IfaceType.lhs TcIface.lhs fptools/ghc/compiler/main Packages.lhs fptools/ghc/compiler/ndpFlatten Flattening.hs fptools/ghc/compiler/rename RnTypes.lhs ...

Simon Peyton Jones simonpj at microsoft.com
Wed Nov 16 07:55:59 EST 2005


simonpj     2005/11/16 04:55:59 PST

  Modified files:
    ghc/compiler/codeGen ClosureInfo.lhs 
    ghc/compiler/iface   BuildTyCl.lhs IfaceSyn.lhs IfaceType.lhs 
                         TcIface.lhs 
    ghc/compiler/main    Packages.lhs 
    ghc/compiler/ndpFlatten Flattening.hs 
    ghc/compiler/rename  RnTypes.lhs 
    ghc/compiler/typecheck TcMType.lhs TcSimplify.lhs 
                           TcTyDecls.lhs TcType.lhs TcUnify.lhs 
    ghc/compiler/types   TyCon.lhs Type.lhs TypeRep.lhs Unify.lhs 
    ghc/compiler/utils   Util.lhs 
  Log:
  Two significant changes to the representation of types
  
  1. Change the representation of type synonyms
  
      Up to now, type synonym applications have been held in
      *both* expanded *and* un-expanded form.  Unfortunately, this
      has exponential (!) behaviour when type synonyms are deeply
      nested.  E.g.
  	    type P a b = (a,b)
  	    f :: P a (P b (P c (P d e)))
      
      This showed up in a program of Joel Reymont, now immortalised
      as typecheck/should_compile/syn-perf.hs
  
      So now synonyms are held as ordinary TyConApps, and expanded
      only on demand.  
  
      SynNote has disappeared altogether, so the only remaining TyNote
      is a FTVNote.  I'm not sure if it's even useful.
  
  2. Eta-reduce newtypes
  
      See the Note [Newtype eta] in TyCon.lhs
      
      If we have 
  	    newtype T a b = MkT (S a b)
      
      then, in Core land, we would like S = T, even though the application
      of T is then not saturated. This commit eta-reduces T's RHS, and
      keeps that inside the TyCon (in nt_etad_rhs).  Result is that 
      coreEqType can be simpler, and has less need of expanding newtypes.
  
  
  
  
  Revision  Changes    Path
  1.71      +0 -1      fptools/ghc/compiler/codeGen/ClosureInfo.lhs
  1.11      +42 -22    fptools/ghc/compiler/iface/BuildTyCl.lhs
  1.21      +3 -3      fptools/ghc/compiler/iface/IfaceSyn.lhs
  1.19      +1 -1      fptools/ghc/compiler/iface/IfaceType.lhs
  1.44      +5 -3      fptools/ghc/compiler/iface/TcIface.lhs
  1.50      +1 -8      fptools/ghc/compiler/main/Packages.lhs
  1.14      +8 -12     fptools/ghc/compiler/ndpFlatten/Flattening.hs
  1.37      +1 -1      fptools/ghc/compiler/rename/RnTypes.lhs
  1.74      +28 -37    fptools/ghc/compiler/typecheck/TcMType.lhs
  1.161     +1 -1      fptools/ghc/compiler/typecheck/TcSimplify.lhs
  1.102     +11 -20    fptools/ghc/compiler/typecheck/TcTyDecls.lhs
  1.128     +66 -56    fptools/ghc/compiler/typecheck/TcType.lhs
  1.74      +34 -24    fptools/ghc/compiler/typecheck/TcUnify.lhs
  1.86      +135 -68   fptools/ghc/compiler/types/TyCon.lhs
  1.140     +82 -74    fptools/ghc/compiler/types/Type.lhs
  1.44      +16 -22    fptools/ghc/compiler/types/TypeRep.lhs
  1.25      +9 -7      fptools/ghc/compiler/types/Unify.lhs
  1.85      +8 -1      fptools/ghc/compiler/utils/Util.lhs


More information about the Cvs-ghc mailing list