[commit: ghc] master: Refactor the treatment of lexically-scoped type variables for instance declarations (2bfc653)

git at git.haskell.org git at git.haskell.org
Tue Nov 4 10:38:22 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2bfc65303e0d6f2ee25a565d0998d6c00aab24d5/ghc

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

commit 2bfc65303e0d6f2ee25a565d0998d6c00aab24d5
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Oct 29 16:54:47 2014 +0000

    Refactor the treatment of lexically-scoped type variables for instance declarations
    
    Previously the univerally-quantified variables of the DFun were also (bizarrely)
    used as the lexically-scoped variables of the instance declaration.  So, for example,
    the DFun's type could not be alpha-renamed.  This was an odd restriction, which has
    bitten me several times.
    
    This patch does the Right Thing, by adding an ib_tyvars field to the
    InstBindings record, which captures the lexically scoped variables.
    Easy, robust, nice.  (I think this record probably didn't exist originally,
    hence the hack.)


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

2bfc65303e0d6f2ee25a565d0998d6c00aab24d5
 compiler/typecheck/TcDeriv.lhs       | 20 ++++++++++----------
 compiler/typecheck/TcEnv.lhs         | 13 +++++++++----
 compiler/typecheck/TcGenGenerics.lhs |  3 +++
 compiler/typecheck/TcInstDcls.lhs    | 13 ++++++-------
 4 files changed, 28 insertions(+), 21 deletions(-)

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

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2bfc65303e0d6f2ee25a565d0998d6c00aab24d5


More information about the ghc-commits mailing list