ghc-7.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

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
- mkUnique :: Char -> Int -> Unique
- unpkUnique :: Unique -> (Char, Int)
- incrUnique :: Unique -> Unique
- deriveUnique :: Unique -> Int -> Unique
- newTagUnique :: Unique -> Char -> Unique
- initTyVarUnique :: Unique
- mkAlphaTyVarUnique :: Int -> Unique
- mkPrimOpIdUnique :: Int -> Unique
- mkTupleTyConUnique :: TupleSort -> Int -> Unique
- mkTupleDataConUnique :: TupleSort -> 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
- mkCostCentreUnique :: Int -> Unique
- mkBuiltinUnique :: Int -> Unique
- mkPseudoUniqueD :: Int -> Unique
- mkPseudoUniqueE :: Int -> Unique
- mkPseudoUniqueH :: Int -> Unique

# Main data types

data Unique

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

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

Methods

getUnique :: a -> Unique

Instances

Uniquable Int |
Uniquable PackageKey |
Uniquable ModuleName |
Uniquable Module |
Uniquable OccName |
Uniquable FastString |
Uniquable Name |
Uniquable Unique |
Uniquable RegClass |
Uniquable Reg |
Uniquable RealReg |
Uniquable VirtualReg |
Uniquable Reg | so we can put regs in UniqSets
Uniquable TyCon |
Uniquable DataCon |
Uniquable PatSyn |
Uniquable ConLike |
Uniquable Var |
Uniquable Class |
Uniquable CoAxiomRule |
Uniquable LocalReg |
Uniquable name => Uniquable (AnnTarget name) |
Uniquable (CoAxiom br) |

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

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

pprUnique :: Unique -> SDoc

mkUniqueGrimily :: Int -> Unique

getKey :: Unique -> Int

getKeyFastInt :: Unique -> FastInt

mkUnique :: Char -> Int -> Unique

unpkUnique :: Unique -> (Char, Int)

incrUnique :: Unique -> Unique

deriveUnique :: Unique -> Int -> Unique

newTagUnique :: Unique -> Char -> Unique

initTyVarUnique :: Unique

## Making built-in uniques

mkAlphaTyVarUnique :: Int -> Unique

mkPrimOpIdUnique :: Int -> Unique

mkTupleTyConUnique :: TupleSort -> Int -> Unique

mkTupleDataConUnique :: TupleSort -> 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

mkCostCentreUnique :: Int -> Unique

mkBuiltinUnique :: Int -> Unique

mkPseudoUniqueD :: Int -> Unique

mkPseudoUniqueE :: Int -> Unique

mkPseudoUniqueH :: Int -> Unique