ghc-lib-parser-9.14.1.20251220: 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
- isCTupleTyConUnique :: Unique -> Maybe Arity
- 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 #

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

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

## Anonymous sums

mkSumTyConUnique :: Arity -> Unique #

mkSumDataConUnique :: ConTagZ -> Arity -> Unique #

isSumTyConUnique :: Unique -> Maybe Arity #

Inverse of `mkSumTyConUnique`

## Tuples

### Vanilla

mkTupleTyConUnique :: Boxity -> Arity -> Unique #

mkTupleDataConUnique :: Boxity -> Arity -> Unique #

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

Inverse of `mkTupleTyConUnique`

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

Inverse of `mkTupleTyDataUnique` that also matches the worker and promoted tycon.

### Constraint

mkCTupleTyConUnique :: Arity -> Unique #

mkCTupleDataConUnique :: Arity -> Unique #

mkCTupleSelIdUnique :: ConTagZ -> Arity -> Unique #

isCTupleTyConUnique :: Unique -> Maybe Arity #

Inverse of `mkCTupleTyConUnique`

## Making built-in uniques

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 #

## Deriving uniques

### From TyCon name uniques

tyConRepNameUnique :: Unique -> Unique #

### From DataCon name uniques

dataConWorkerUnique :: Unique -> Unique #

dataConTyRepNameUnique :: Unique -> Unique #

initExitJoinUnique :: Unique #

mkBoxingTyConUnique :: Int -> Unique #

boxingDataConUnique :: Unique -> Unique #