Haskell).
\begin{code}
+{-# LANGUAGE BangPatterns #-}
module Unique (
-- * Main data types
Unique, Uniquable(..),
import FastTypes
import FastString
import Outputable
-import StaticFlags
+-- import StaticFlags
#if defined(__GLASGOW_HASKELL__)
--just for implementing a fast [0,61) -> Char function
\begin{code}
pprUnique :: Unique -> SDoc
pprUnique uniq
- | opt_SuppressUniques
- = empty -- Used exclusively to suppress uniques so you
- | otherwise -- can compare output easily
+-- | opt_SuppressUniques
+-- = empty -- Used exclusively to suppress uniques so you
+-- | otherwise -- can compare output easily
= case unpkUnique uniq of
(tag, u) -> finish_ppr tag u (text (iToBase62 u))
mkRegPairUnique = mkUnique 'P'
mkRegClassUnique = mkUnique 'L'
-mkVarOccUnique, mkDataOccUnique, mkTvOccUnique, mkTcOccUnique :: FastString -> Unique
+mkVarOccUnique :: FastString -> Int -> Unique
+mkVarOccUnique fs depth =
+ if depth > 255
+ then error "FIXME: no support for syntactic depth > 255"
+ else mkUnique 'i' ((iBox (uniqueOfFS fs)) * 8 + depth )
+
+mkDataOccUnique, mkTvOccUnique, mkTcOccUnique :: FastString -> Unique
-- See Note [The Unique of an OccName] in OccName
-mkVarOccUnique fs = mkUnique 'i' (iBox (uniqueOfFS fs))
mkDataOccUnique fs = mkUnique 'd' (iBox (uniqueOfFS fs))
mkTvOccUnique fs = mkUnique 'v' (iBox (uniqueOfFS fs))
mkTcOccUnique fs = mkUnique 'c' (iBox (uniqueOfFS fs))