ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Builtin.Uniques

Contents

- Looking up known-key names
- Getting the `Unique`s of `Name`s
  - Anonymous sums
  - Tuples
    - Vanilla
    - Constraint
  - Making built-in uniques
  - Deriving uniques
    - From TyCon name uniques
    - From DataCon name uniques

Description

This is where we define a mapping from Uniques to their associated known-key Names for things associated with tuples and sums. We use this mapping while deserializing known-key Names in interface file symbol tables, which are encoded as their Unique. See Note [Symbol table representation of names] for details.

Synopsis

- knownUniqueName :: Unique -> Maybe Name
- mkSumTyConUnique :: Arity -> Unique
- mkSumDataConUnique :: ConTagZ -> Arity -> Unique
- mkTupleTyConUnique :: Boxity -> Arity -> Unique
- mkTupleDataConUnique :: Boxity -> Arity -> Unique
- mkCTupleTyConUnique :: Arity -> Unique
- mkCTupleDataConUnique :: Arity -> Unique
- mkCTupleSelIdUnique :: ConTagZ -> Arity -> Unique
- mkAlphaTyVarUnique :: Int -> Unique
- mkPrimOpIdUnique :: Int -> Unique
- mkPrimOpWrapperUnique :: Int -> Unique
- mkPreludeMiscIdUnique :: Int -> Unique
- mkPreludeDataConUnique :: Int -> Unique
- mkPreludeTyConUnique :: Int -> Unique
- mkPreludeClassUnique :: 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
- mkPseudoUniqueE :: Int -> Unique
- tyConRepNameUnique :: Unique -> Unique
- dataConWorkerUnique :: Unique -> Unique
- dataConTyRepNameUnique :: Unique -> Unique
- initExitJoinUnique :: Unique
- mkBoxingTyConUnique :: Int -> Unique
- boxingDataConUnique :: Unique -> Unique

# Looking up known-key names

knownUniqueName :: Unique -> Maybe Name Source #

Get the `Name` associated with a known-key `Unique`.

# Getting the `Unique`s of `Name`s

## Anonymous sums

mkSumTyConUnique :: Arity -> Unique Source #

mkSumDataConUnique :: ConTagZ -> Arity -> Unique Source #

## Tuples

### Vanilla

mkTupleTyConUnique :: Boxity -> Arity -> Unique Source #

mkTupleDataConUnique :: Boxity -> Arity -> Unique Source #

### Constraint

mkCTupleTyConUnique :: Arity -> Unique Source #

mkCTupleDataConUnique :: Arity -> Unique Source #

mkCTupleSelIdUnique :: ConTagZ -> Arity -> Unique Source #

## Making built-in uniques

mkAlphaTyVarUnique :: Int -> Unique Source #

mkPrimOpIdUnique :: Int -> Unique Source #

mkPrimOpWrapperUnique :: Int -> Unique Source #

mkPreludeMiscIdUnique :: Int -> Unique Source #

mkPreludeDataConUnique :: Int -> Unique Source #

mkPreludeTyConUnique :: Int -> Unique Source #

mkPreludeClassUnique :: 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 #

mkCostCentreUnique :: Int -> Unique Source #

mkBuiltinUnique :: Int -> Unique Source #

mkPseudoUniqueE :: Int -> Unique Source #

## Deriving uniques

### From TyCon name uniques

tyConRepNameUnique :: Unique -> Unique Source #

### From DataCon name uniques

dataConWorkerUnique :: Unique -> Unique Source #

dataConTyRepNameUnique :: Unique -> Unique Source #

initExitJoinUnique :: Unique Source #

mkBoxingTyConUnique :: Int -> Unique Source #

boxingDataConUnique :: Unique -> Unique Source #