X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FbasicTypes%2FUnique.lhs;h=5f9f66834f3a5ff311b397f15face7018331ea43;hb=aafdba3bce91afb003f5f50e001e141744837bae;hp=a0b28f83758f8386f5103446d390805cd3f3705f;hpb=317fc69d18eda68fd65f5ba634feafbe4a3923da;p=ghc-hetmet.git diff --git a/compiler/basicTypes/Unique.lhs b/compiler/basicTypes/Unique.lhs index a0b28f8..5f9f668 100644 --- a/compiler/basicTypes/Unique.lhs +++ b/compiler/basicTypes/Unique.lhs @@ -16,6 +16,13 @@ Some of the other hair in this code is to be able to use a Haskell). \begin{code} +{-# OPTIONS -w #-} +-- 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/Commentary/CodingStyle#Warnings +-- for details + module Unique ( Unique, Uniquable(..), hasKey, @@ -50,11 +57,10 @@ module Unique ( #include "HsVersions.h" +import StaticFlags import BasicTypes -import PackageConfig import FastString import Outputable -import FastTypes import GHC.Exts import Data.Char ( chr, ord ) @@ -149,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} @@ -195,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))