ghc-lib-parser-9.12.2.20250421: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

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
- isSumTyConUnique :: Unique -> Maybe Arity
- mkTupleTyConUnique :: Boxity -> Arity -> Unique
- mkTupleDataConUnique :: Boxity -> Arity -> Unique
- isTupleTyConUnique :: Unique -> Maybe (Boxity, Arity)
- isTupleDataConLikeUnique :: Unique -> Maybe (Boxity, Arity)
- 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
- mkRegSingleUnique :: Int -> Unique
- mkRegPairUnique :: Int -> Unique
- mkRegClassUnique :: Int -> Unique
- mkRegSubUnique :: Int -> Unique
- mkCostCentreUnique :: Int -> Unique
- varNSUnique :: Unique
- dataNSUnique :: Unique
- tvNSUnique :: Unique
- tcNSUnique :: Unique
- mkFldNSUnique :: FastString -> Unique
- isFldNSUnique :: Unique -> Bool
- 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 #

isSumTyConUnique :: Unique -> Maybe Arity Source #

## Tuples

### Vanilla

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

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

isTupleTyConUnique :: Unique -> Maybe (Boxity, Arity) Source #

This function is an inverse of `mkTupleTyConUnique`

isTupleDataConLikeUnique :: Unique -> Maybe (Boxity, Arity) Source #

This function is an inverse of `mkTupleTyDataUnique` that also matches the worker and promoted tycon.

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

mkRegSingleUnique :: Int -> Unique Source #

mkRegPairUnique :: Int -> Unique Source #

mkRegClassUnique :: Int -> Unique Source #

mkRegSubUnique :: Int -> Unique Source #

mkCostCentreUnique :: Int -> Unique Source #

varNSUnique :: Unique Source #

dataNSUnique :: Unique Source #

tvNSUnique :: Unique Source #

tcNSUnique :: Unique Source #

mkFldNSUnique :: FastString -> Unique Source #

isFldNSUnique :: Unique -> Bool 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 #