[commit: ghc] type-holes-branch: Another refactoring of constraints (c54c46e)

Simon Peyton Jones <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : type-holes-branch

http://hackage.haskell.org/trac/ghc/changeset/c54c46e647f8edb09d667ac403e66f3a07ed7192

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

commit c54c46e647f8edb09d667ac403e66f3a07ed7192
Author: Simon Peyton Jones <[email protected]>
Date:   Mon Sep 10 10:01:51 2012 +0100

    Another refactoring of constraints
    
    1. Rejig CtLoc
       * CtLoc is now *not* parameterised (much simpler)
       * CtLoc includes the "depth" of the constraint
       * CtLoc includes the TcLclEnv at the birthplace
         That gives (a) the SrcSpan, (b) the [ErrCtxt]
         (c) the [TcIdBinder]
       * The CtLoc of a constraint is no longer in its CtEvidence
       * Where we passed 'depth' before, now we pass CtLoc
    
    2. Some significant refactoring in TcErrors
       * Get rid of cec_extra
       * Traverse every constraint, so that we can be
         sure to generate bindings where necessary.
         (This was really a lurking bug before.)
    
    3. Merge zonking into TcCanonical.  This turned out to be
       almost trivial; just a small change to TcCanonical.flattenTyVar.
    
       The nice consequence is that we don't need to zonk a constraint
       before solving it; instead it gets zonked "on the fly" as it were.

 compiler/typecheck/Inst.lhs        |  101 ++------
 compiler/typecheck/TcCanonical.lhs |  417 ++++++++++++++---------------
 compiler/typecheck/TcErrors.lhs    |  509 +++++++++++++++---------------------
 compiler/typecheck/TcExpr.lhs      |    2 +-
 compiler/typecheck/TcInteract.lhs  |  207 +++++++--------
 compiler/typecheck/TcMType.lhs     |   26 +--
 compiler/typecheck/TcRnMonad.lhs   |    9 +-
 compiler/typecheck/TcRnTypes.lhs   |  157 +++++------
 compiler/typecheck/TcRules.lhs     |    8 +-
 compiler/typecheck/TcSMonad.lhs    |   90 ++++---
 compiler/typecheck/TcSimplify.lhs  |   28 ++-
 compiler/typecheck/TcType.lhs      |   19 +-
 compiler/typecheck/TcUnify.lhs     |    9 +-
 13 files changed, 695 insertions(+), 887 deletions(-)


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

    git show c54c46e647f8edb09d667ac403e66f3a07ed7192
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.