Simplify AbsBinds wrapping
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 12 Feb 2016 13:36:17 +0000 (13:36 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 12 Feb 2016 17:37:11 +0000 (17:37 +0000)
commitc6485d5e6daec20c8ff66d6e721d3e0a5f3156ac
tree33f58e16c68e8eadc0c02b16456f85d6dc3a31da
parentf3b9db31e099836420fbf88eaa36f6fe3d6b85b5
Simplify AbsBinds wrapping

In poking Trac #11414 I found myself sinking into the abe_inst_wrap
swamp.  What is this strange thing?  (It turned out that #11414 was
breaking because of it.)

Thrillingly, I found a way to sweep it away again, putting the deep
instantation into tcMonoBinds instead of mkExport; and it turned out
that the fun_co_fn field of FunBind was already there ready to receive
exactly this wrapper. Hooray.  Result

* Death to abe_inst_wrap
* Death to mbi_orig
* Death to the plumbing in tcPolyInfer that did the
  deep instantiation

I did find that I had to re-engineer the treatment of instance type
signatures (again), but the result looks more modular and robust to
me.

And #11414 is fixed.
compiler/deSugar/DsBinds.hs
compiler/hsSyn/HsBinds.hs
compiler/typecheck/TcBinds.hs
compiler/typecheck/TcClassDcl.hs
compiler/typecheck/TcHsSyn.hs
compiler/typecheck/TcInstDcls.hs
testsuite/tests/deSugar/should_compile/all.T