This patch implements the Clean up printing of foralls proposal:
-
Whenever printing variables quantified in a forall, print inferred variables with braces.
-
Maximally instantiate any inferred or dictionary arguments (class constraints) to expressions passed to :type
It also addresses a part of #16320. Specifically, it adds two more
conditions to the predicate that decides if forall
s should be
printed. GHC will now print forall
s if any of these is also true:
-
The foralls are not all at the top. Exception: foralls are allowed to be mixed with class constraints, but no foralls can appear under a proper ->.
-
Two quantified type variables are spelled the same
It does not address Inefficient implementation of eliminateRuntimeReps and Extremely confusing swizzling of foralls and contexts yet.