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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/5efe9b1146bd474a6f408093ef36c262b15b4ab2

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

commit 5efe9b1146bd474a6f408093ef36c262b15b4ab2
Author: Simon Peyton Jones <simo...@microsoft.com>
Date:   Tue Jan 1 23:09:32 2013 +0000

    Refactor the invariants for ClsInsts
    
    We now have the invariant for a ClsInst that the is_tvs field
    is always completely fresh type variables. See
    Note [Template tyvars are fresh] in InstEnv.
    
    (Previously we frehened them when extending the instance environment,
    but that seems messier because it was an invariant only when the
    ClsInst was in an InstEnv.  Moreover, there was an invariant that
    thet tyvars of the DFunid in the ClsInst had to match, and I have
    removed that invariant altogether; there is no need for it.)
    
    Other changes I made at the same time:
    
     * Make is_tvs into a *list*, in the right order for the dfun type
       arguments.  This removes the wierd need for the dfun to have the
       same tyvars as the ClsInst template, an invariant I have always
       hated. The cost is that we need to make it a VarSet when matching.
       We could cache an is_tv_set instead.
    
     * Add a cached is_cls field to the ClsInst, to save fishing
       the Class out of the DFun.  (Renamed is_cls to is_cls_nm.)
    
     * Make tcSplitDFunTy return the dfun args, not just the *number*
       of dfun args
    
     * Make InstEnv.instanceHead return just the *head* of the
       instance declaration.  Add instanceSig to return the whole
       thing.

 compiler/coreSyn/CoreSubst.lhs       |    2 +-
 compiler/coreSyn/CoreUnfold.lhs      |    4 +-
 compiler/iface/MkIface.lhs           |    7 +-
 compiler/main/TidyPgm.lhs            |   12 +---
 compiler/typecheck/Inst.lhs          |  112 +++++++++++++--------------
 compiler/typecheck/TcDeriv.lhs       |   30 ++++----
 compiler/typecheck/TcEnv.lhs         |    2 +-
 compiler/typecheck/TcGenGenerics.lhs |   23 +++---
 compiler/typecheck/TcInstDcls.lhs    |    7 +-
 compiler/typecheck/TcSplice.lhs      |    5 +-
 compiler/typecheck/TcType.lhs        |   21 ++---
 compiler/types/FunDeps.lhs           |   12 +--
 compiler/types/InstEnv.lhs           |  136 +++++++++++++++++----------------
 13 files changed, 181 insertions(+), 192 deletions(-)


Diff suppressed because of size. To see it, use:

    git show 5efe9b1146bd474a6f408093ef36c262b15b4ab2

_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to