- -- Keyed by OccName; when looking up a qualified name
- -- we look up the OccName part, and then check the Provenance
- -- to see if the appropriate qualification is valid. This
- -- saves routinely doubling the size of the env by adding both
- -- qualified and unqualified names to the domain.
- --
- -- The list in the range is reqd because there may be name clashes
- -- These only get reported on lookup, not on construction
-
- -- INVARIANT: All the members of the list have distinct
- -- gre_name fields; that is, no duplicate Names
+-- ^ Keyed by 'OccName'; when looking up a qualified name
+-- we look up the 'OccName' part, and then check the 'Provenance'
+-- to see if the appropriate qualification is valid. This
+-- saves routinely doubling the size of the env by adding both
+-- qualified and unqualified names to the domain.
+--
+-- The list in the codomain is required because there may be name clashes
+-- These only get reported on lookup, not on construction
+--
+-- INVARIANT: All the members of the list have distinct
+-- 'gre_name' fields; that is, no duplicate Names
+--
+-- INVARIANT: Imported provenance => Name is an ExternalName
+-- However LocalDefs can have an InternalName. This
+-- happens only when type-checking a [d| ... |] Template
+-- Haskell quotation; see this note in RnNames
+-- Note [Top-level Names in Template Haskell decl quotes]