How to best display type variables with the same name

Simon Peyton Jones simonpj at
Wed Oct 19 16:00:54 UTC 2016

I’m afraid I didn’t understand the issue in the link below.  It speaks of “querying the type”, but I’m not sure what that means.  A GHCi session perhaps?  Does this relate to the way GHCi displays types?

I’m a bit lost.  A from-the-beginning example, showing steps and what the unexpected behaviour is would be helpful (to me anyway)


From: ghc-devs [mailto:ghc-devs-bounces at] On Behalf Of Christopher Done
Sent: 19 October 2016 12:46
To: ghc-devs at
Subject: How to best display type variables with the same name

We've encountered a problem in Intero which is that when inspecting types of expressions and patterns, sometimes it happens that the type, when pretty printing, yields variables of the same name but which have different provenance.

Here's a summary of the issue:<>

And a strawman proposal of how it could be solved:<>

What do you think?

Also, if I were to implement the strawman proposal, is it possible to recover from a `tyvar :: Type` its original quantification/its "forall"? I've had a look through the API briefly and it looks like a _maybe_.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list