Fix #16293 by cleaning up Proxy# infelicities
This bug fixes three problems related to Proxy#
/proxy#
:
-
Reifying it with TH claims that the
Proxy#
type constructor has two arguments, but that ought to be one for consistency with TH's treatment for other primitive type constructors like(->)
. This was fixed by just returning the number oftyConVisibleTyVars
instead of usingtyConArity
(which includes invisible arguments). -
The role of
Proxy#
's visible argument was hard-coded as nominal. Easily fixed by changing it to phantom. -
The visibility of
proxy#
's kind argument was specified, which is different from theProxy
constructor (which treats it as inferred). Some minor refactoring inproxyHashId
fixed ths up.Along the way, I had to introduce a
mkSpecForAllTy
function, so I did some related Haddock cleanup inType
, where that function lives.