Draft: Id provenance and Mult vs UsageEnv
For #23218
Just a draft! Nothing to see here yet.
This first MR should close #18694 only
-
Enforce somehow (documenting invariants, newtypes, phantom parameters) the kinds of Ids that things receive (e.g. selectMatchVar could always output a lambda bound variable -- I'm not sure that's correct, or a mkGlobalVar guaranteed to return a let bound var)
- It would be especially useful to find these invariants. If we know that, it'd be much simpler to thread correct IdBindings thorought