Draft: implement the new generalisation defaulting plan
I'm putting up this early draft for discussion only; it's far from being correct at the moment.
The main idea is that I am implementing the plan described in #20686 by refactoring GHC.Tc.Solver.decideQuantification
.
Overview:
-
GHC.Tc.Solver.decideQuantification
has been rewritten to follow the design of #20686. -
GHC.Tc.Solver.decideQuantifiedTyVars
collects up variables for promotion and defaulting as described in the plan. -
GHC.Tc.Utils.TcMType.collectComponentTyVars
finds the kind,RuntimeRep
and multiplicity components. It's meant to replacecollect_cand_qtvs
, but I haven't removed the old functions yet. -
GHC.Tc.Solver.quantifiableCt
re-implementspickQuantifiablePreds
in a way that is more appropriate for the new defaulting plan where we only decide on which variables to quantify over at the end.
TODO:
-
Update Notes referring to decidePromotedTyVars
anddefaultTyVarsAndSimplify
.
Edited by sheaf