A NameShape is a substitution on Names that can be used
to refine the identities of a hole while we are renaming interfaces
(see GHC.Iface.Rename). Specifically, a NameShape for
ns_module_name A, defines a mapping from {A.T}
(for some OccName T) to some arbitrary other Name.
The most intriguing thing about a NameShape, however, is
how it's constructed. A NameShape is *implied* by the
exported AvailInfos of the implementor of an interface:
if an implementor of signature <H> exports M.T, you implicitly
define a substitution from {H.T} to M.T. So a NameShape
is computed from the list of AvailInfos that are exported
by the implementation of a module, or successively merged
together by the export lists of signatures which are joining
together.
It's not the most obvious way to go about doing this, but it does seem to work!
NB: Can't boot this and put it in NameShape because then we start pulling in too many DynFlags things.