Make the printing of types more truthful
Consider
class C a where
op :: forall b. Eq b => a -> b -> b
Then in fact op :: forall a. C a => forall b. Eq b => a -> b -> b
.
But if we print that type, we display forall a b. (C a, Eq b) => a -> b -> b
. This is not because we instantiate op
and re-generalise. It's just how we print the type. See GHC.Iface.Type.splitIfaceSigmaTy
.
We did this to make types seem more intuitive when printed. But I regularly trip over this when debugging, and puzzle about the shapes of types and terms.
I wonder if this is also potentially confusing for users too. Suggestion: print the foralls and constraints as they truly are, not "helpfully" rearranged.