Properly keep track of whether normalising given or wanted dicts
[ghc-hetmet.git] / compiler / basicTypes / Unique.lhs
index 15cf350..5f9f668 100644 (file)
@@ -20,7 +20,7 @@ Haskell).
 -- The above warning supression flag is a temporary kludge.
 -- While working on this module you are encouraged to remove it and fix
 -- any warnings in the module. See
---     http://hackage.haskell.org/trac/ghc/wiki/CodingStyle#Warnings
+--     http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
 -- for details
 
 module Unique (
@@ -57,8 +57,8 @@ module Unique (
 
 #include "HsVersions.h"
 
+import StaticFlags
 import BasicTypes
-import PackageConfig
 import FastString
 import Outputable
 
@@ -155,9 +155,6 @@ x `hasKey` k        = getUnique x == k
 instance Uniquable FastString where
  getUnique fs = mkUniqueGrimily (I# (uniqueOfFS fs))
 
-instance Uniquable PackageId where
- getUnique pid = getUnique (packageIdFS pid)
-
 instance Uniquable Int where
  getUnique i = mkUniqueGrimily i
 \end{code}
@@ -201,6 +198,11 @@ We do sometimes make strings with @Uniques@ in them:
 \begin{code}
 pprUnique :: Unique -> SDoc
 pprUnique uniq
+#ifdef DEBUG
+  | opt_SuppressUniques
+  = empty      -- Used exclusively to suppress uniques so you 
+  | otherwise  -- can compare output easily
+#endif
   = case unpkUnique uniq of
       (tag, u) -> finish_ppr tag u (text (iToBase62 u))