+type QueryQualifyName = Module -> OccName -> QualifyName
+
+data QualifyName -- given P:M.T
+ = NameUnqual -- refer to it as "T"
+ | NameQual ModuleName -- refer to it as "X.T" for the supplied X
+ | NameNotInScope1
+ -- it is not in scope at all, but M.T is not bound in the current
+ -- scope, so we can refer to it as "M.T"
+ | NameNotInScope2
+ -- it is not in scope at all, and M.T is already bound in the
+ -- current scope, so we must refer to it as "P:M.T"
+