[project @ 2001-12-28 17:25:31 by simonpj]
authorsimonpj <unknown>
Fri, 28 Dec 2001 17:25:32 +0000 (17:25 +0000)
committersimonpj <unknown>
Fri, 28 Dec 2001 17:25:32 +0000 (17:25 +0000)
commitae969b4759e1914cb44bf126fc56e2e059d050dc
tree7c01d86418eac883c9bdab844ae660aefe720e22
parent246dab8d62eaeb3e239c49b69ab3ad95299c1b38
[project @ 2001-12-28 17:25:31 by simonpj]
---------------------
Dealing with deriving
---------------------

I spent a ridiculously long time peering at a bug report whereby
a 'deriving' clause sent GHC 5.02.1 into a loop.  It was all to
do with allowing instances like

instance Foo a b => Baz (T a)

(Notice the 'b' on the left which does not appear on the right.)

I realised that it's hard for the deriving machinery to find a
fixpoint when these sort of instance decls are around.  So I
now constrain *derived* instance decls not to have this form;
all the tyvars on the left must appear on the right.

On the way I commoned up the previously-separate tcSimplify
machinery for 'deriving' and 'default' decls with that for
everything else.   As a result, quite a few files are touched.

I hope I havn't broken anything.
ghc/compiler/typecheck/Inst.lhs
ghc/compiler/typecheck/TcDefaults.lhs
ghc/compiler/typecheck/TcDeriv.lhs
ghc/compiler/typecheck/TcMType.lhs
ghc/compiler/typecheck/TcSimplify.lhs