[commit: ghc] master: Fix egregious error in eta-reduction of data families (1160dc5)
git at git.haskell.org
git at git.haskell.org
Fri Dec 4 14:21:21 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/1160dc516f8b27249d819665883409ee270a743f/ghc
>---------------------------------------------------------------
commit 1160dc516f8b27249d819665883409ee270a743f
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Dec 4 12:08:37 2015 +0000
Fix egregious error in eta-reduction of data families
This terrible and long-standing bug was shown up by Trac #11148.
We are trying to eta-reduce a data family instance, so that we
can then derive Functor or Generic. But we were assuming, for
absolutely not reason whatsoever, that the type variables were
lined up in a convenient order. The fact that it ever worked
was a fluke.
This patch fixes it properly. Main change is in eta_reduce
in TcInstDcls.tcDataFamInstDecl
>---------------------------------------------------------------
1160dc516f8b27249d819665883409ee270a743f
compiler/typecheck/TcInstDcls.hs | 92 +++++++++--------------
compiler/types/FamInstEnv.hs | 60 ++++++++++++---
testsuite/tests/deriving/should_compile/Makefile | 10 ++-
testsuite/tests/deriving/should_compile/T11148.hs | 11 +++
testsuite/tests/deriving/should_compile/all.T | 2 +
5 files changed, 109 insertions(+), 66 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 1160dc516f8b27249d819665883409ee270a743f
More information about the ghc-commits
mailing list