ghc-7.0.3: The GHC API

Unique

Contents

- Main data types
  - Constructors, desctructors and operations on `Unique`s
  - Making built-in uniques

Synopsis

- data Unique
- class Uniquable a where
  - getUnique :: a -> Unique
- hasKey :: Uniquable a => a -> Unique -> Bool
- pprUnique :: Unique -> SDoc
- mkUniqueGrimily :: Int -> Unique
- getKey :: Unique -> Int
- getKeyFastInt :: Unique -> FastInt
- incrUnique :: Unique -> Unique
- deriveUnique :: Unique -> Int -> Unique
- newTagUnique :: Unique -> Char -> Unique
- initTyVarUnique :: Unique
- isTupleKey :: Unique -> Bool
- mkAlphaTyVarUnique :: Int -> Unique
- mkPrimOpIdUnique :: Int -> Unique
- mkTupleTyConUnique :: Boxity -> Int -> Unique
- mkTupleDataConUnique :: Boxity -> Int -> Unique
- mkPreludeMiscIdUnique :: Int -> Unique
- mkPreludeDataConUnique :: Int -> Unique
- mkPreludeTyConUnique :: Int -> Unique
- mkPreludeClassUnique :: Int -> Unique
- mkPArrDataConUnique :: Int -> Unique
- mkVarOccUnique :: FastString -> Unique
- mkDataOccUnique :: FastString -> Unique
- mkTvOccUnique :: FastString -> Unique
- mkTcOccUnique :: FastString -> Unique
- mkRegSingleUnique :: Int -> Unique
- mkRegPairUnique :: Int -> Unique
- mkRegClassUnique :: Int -> Unique
- mkRegSubUnique :: Int -> Unique
- mkBuiltinUnique :: Int -> Unique
- mkPseudoUniqueC :: Int -> Unique
- mkPseudoUniqueD :: Int -> Unique
- mkPseudoUniqueE :: Int -> Unique
- mkPseudoUniqueH :: Int -> Unique

# Main data types

data Unique Source

The type of unique identifiers that are used in many places in GHC for fast ordering and equality tests. You should generate these with the functions from the `UniqSupply` module

Instances

Eq Unique |
Ord Unique |
Show Unique |
Outputable Unique |
Uniquable Unique |

class Uniquable a where Source

Class of things that we can obtain a `Unique` from

Methods

getUnique :: a -> Unique Source

Instances

Uniquable Int |
Uniquable PackageId |
Uniquable ModuleName |
Uniquable Module |
Uniquable OccName |
Uniquable FastString |
Uniquable Unique |
Uniquable RegClass |
Uniquable Reg |
Uniquable RealReg |
Uniquable VirtualReg |
Uniquable Reg | so we can put regs in UniqSets
Uniquable SlotClass |
Uniquable TyCon |
Uniquable Name |
Uniquable Var |
Uniquable Class |
Uniquable DataCon |
Uniquable BlockId |
Uniquable LocalReg |
Uniquable Store |
Uniquable name => Uniquable (AnnTarget name) |

## Constructors, desctructors and operations on `Unique`s

hasKey :: Uniquable a => a -> Unique -> Bool Source

pprUnique :: Unique -> SDoc Source

mkUniqueGrimily :: Int -> Unique Source

getKey :: Unique -> Int Source

getKeyFastInt :: Unique -> FastInt Source

incrUnique :: Unique -> Unique Source

deriveUnique :: Unique -> Int -> Unique Source

newTagUnique :: Unique -> Char -> Unique Source

initTyVarUnique :: Unique Source

isTupleKey :: Unique -> Bool Source

## Making built-in uniques

mkAlphaTyVarUnique :: Int -> Unique Source

mkPrimOpIdUnique :: Int -> Unique Source

mkTupleTyConUnique :: Boxity -> Int -> Unique Source

mkTupleDataConUnique :: Boxity -> Int -> Unique Source

mkPreludeMiscIdUnique :: Int -> Unique Source

mkPreludeDataConUnique :: Int -> Unique Source

mkPreludeTyConUnique :: Int -> Unique Source

mkPreludeClassUnique :: Int -> Unique Source

mkPArrDataConUnique :: Int -> Unique Source

mkVarOccUnique :: FastString -> Unique Source

mkDataOccUnique :: FastString -> Unique Source

mkTvOccUnique :: FastString -> Unique Source

mkTcOccUnique :: FastString -> Unique Source

mkRegSingleUnique :: Int -> Unique Source

mkRegPairUnique :: Int -> Unique Source

mkRegClassUnique :: Int -> Unique Source

mkRegSubUnique :: Int -> Unique Source

mkBuiltinUnique :: Int -> Unique Source

mkPseudoUniqueC :: Int -> Unique Source

mkPseudoUniqueD :: Int -> Unique Source

mkPseudoUniqueE :: Int -> Unique Source

mkPseudoUniqueH :: Int -> Unique Source