Use level numbers for generalisation
GHC's type inference engine goes to quite a bit of effort to pin a level number on every type variable (both skolems and unification variables).
Idea: when generalising a type or kind, use those level numbers to decide which variables to generalise.
This could completely replace the "global tyvars" field of the TcLclEnv (the tcl_tyvars field), which is very tiresome to maintain.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |