\begin{code}
data Name = Name {
n_sort :: NameSort, -- What sort of name it is
- n_occ :: OccName, -- Its occurrence name
+ n_occ :: !OccName, -- Its occurrence name
n_uniq :: Unique,
- n_loc :: SrcLoc -- Definition site
+ n_loc :: !SrcLoc -- Definition site
}
+-- NOTE: we make the n_loc field strict to eliminate some potential
+-- (and real!) space leaks, due to the fact that we don't look at
+-- the SrcLoc in a Name all that often.
+
data NameSort
= Global Module -- (a) TyCon, Class, their derived Ids, dfun Id
-- (b) Imported Id
-- Like Local, except that we only omit the unique in Iface style
pprSysLocal sty uniq occ
| codeStyle sty = pprUnique uniq
- | ifaceStyle sty = pprOccName occ -- The tidy phase has ensured that OccNames
- -- are enough
+ | ifaceStyle sty = pprOccName occ -- The tidy phase has ensured
+ -- that OccNames are enough
| otherwise = pprOccName occ <> char '_' <> pprUnique uniq
-- If the tidy phase hasn't run, the OccName
-- is unlikely to be informative (like 's'),