[commit: ghc] wip/new-flatten-skolems-Oct14: Refactor the treatment of lexically-scoped type variables for instance declarations (19eb2cc)
git at git.haskell.org
git at git.haskell.org
Thu Oct 30 12:54:23 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/new-flatten-skolems-Oct14
Link : http://ghc.haskell.org/trac/ghc/changeset/19eb2ccc4cded8d327ec6c3c1a8c1a538c05e35a/ghc
>---------------------------------------------------------------
commit 19eb2ccc4cded8d327ec6c3c1a8c1a538c05e35a
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.)
>---------------------------------------------------------------
19eb2ccc4cded8d327ec6c3c1a8c1a538c05e35a
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 19eb2ccc4cded8d327ec6c3c1a8c1a538c05e35a
More information about the ghc-commits
mailing list