[commit: ghc] wip/new-flatten-skolems-Oct14: Refactor the treatment of lexically-scoped type variables for instance declarations (0ce46e7)

git at git.haskell.org git at git.haskell.org
Fri Oct 31 13:43:11 UTC 2014


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

On branch  : wip/new-flatten-skolems-Oct14
Link       : http://ghc.haskell.org/trac/ghc/changeset/0ce46e7025f31df5c0b96bd5319361505101e59b/ghc

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

commit 0ce46e7025f31df5c0b96bd5319361505101e59b
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.)


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

0ce46e7025f31df5c0b96bd5319361505101e59b
 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 0ce46e7025f31df5c0b96bd5319361505101e59b


More information about the ghc-commits mailing list