+nameOccName (Local _ n _ _) = Unqual n
+nameOccName (Global _ m (Left n) _ _ [] ) = Qual m n
+nameOccName (Global _ m (Right n) _ _ [] ) = let str = _CONCAT_ (glue n) in
+ --pprTrace "nameOccName:" (ppPStr str) $
+ Qual m str
+nameOccName (Global _ m (Left _) _ _ (o:_)) = o
+nameOccName (Global _ m (Right _) _ _ (o:_)) = panic "nameOccName:compound name"
+
+nameExportFlag (Local _ _ _ _) = NotExported
+nameExportFlag (Global _ _ _ _ exp _) = exp
+
+nameSrcLoc (Local _ _ _ loc) = loc
+nameSrcLoc (Global _ _ _ (LocalDef loc) _ _) = loc
+nameSrcLoc (Global _ _ _ (Imported _ loc _) _ _) = loc
+nameSrcLoc (Global _ _ _ Implicit _ _) = mkUnknownSrcLoc
+nameSrcLoc (Global _ _ _ Primitive _ _) = mkBuiltinSrcLoc
+nameSrcLoc (Global _ _ _ (WiredIn _) _ _) = mkBuiltinSrcLoc
+
+nameImpLocs (Global _ _ _ (Imported _ _ locs) _ _) = locs
+nameImpLocs _ = []
+
+nameImportFlag (Local _ _ _ _) = NotExported
+nameImportFlag (Global _ _ _ (LocalDef _) _ _) = ExportAll
+nameImportFlag (Global _ _ _ (Imported exp _ _) _ _) = exp
+nameImportFlag (Global _ _ _ Implicit _ _) = ExportAll
+nameImportFlag (Global _ _ _ Primitive _ _) = ExportAll
+nameImportFlag (Global _ _ _ (WiredIn _) _ _) = ExportAll
+
+isLocallyDefinedName (Local _ _ _ _) = True
+isLocallyDefinedName (Global _ _ _ (LocalDef _) _ _) = True
+isLocallyDefinedName (Global _ _ _ (Imported _ _ _) _ _) = False
+isLocallyDefinedName (Global _ _ _ Implicit _ _) = False
+isLocallyDefinedName (Global _ _ _ Primitive _ _) = False
+isLocallyDefinedName (Global _ _ _ (WiredIn from_here) _ _) = from_here
+
+isWiredInName (Global _ _ _ (WiredIn _) _ _) = True
+isWiredInName _ = False