Unique

ghc-8.4.2: The GHC API

Safe Haskell | None
Language | Haskell2010

Unique

Contents

- Main data types
  - Constructors, destructors and operations on `Unique`s
  - Making built-in uniques
  - Deriving uniques
    - From TyCon name uniques
    - From DataCon name uniques

Synopsis

- data Unique
- class Uniquable a where
- uNIQUE_BITS :: Int
- hasKey :: Uniquable a => a -> Unique -> Bool
- pprUniqueAlways :: Unique -> SDoc
- mkUniqueGrimily :: Int -> Unique
- getKey :: Unique -> Int
- mkUnique :: Char -> Int -> Unique
- unpkUnique :: Unique -> (Char, Int)
- deriveUnique :: Unique -> Int -> Unique
- newTagUnique :: Unique -> Char -> Unique
- initTyVarUnique :: Unique
- initExitJoinUnique :: Unique
- nonDetCmpUnique :: Unique -> Unique -> Ordering
- isValidKnownKeyUnique :: Unique -> Bool
- mkAlphaTyVarUnique :: Int -> Unique
- mkPrimOpIdUnique :: Int -> Unique
- mkPreludeMiscIdUnique :: Int -> Unique
- mkPreludeDataConUnique :: Arity -> Unique
- mkPreludeTyConUnique :: Int -> Unique
- mkPreludeClassUnique :: Int -> Unique
- mkPArrDataConUnique :: Int -> Unique
- mkCoVarUnique :: 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
- tyConRepNameUnique :: Unique -> Unique
- dataConWorkerUnique :: Unique -> Unique
- dataConRepNameUnique :: Unique -> Unique

# Main data types

data Unique Source #

Unique identifier.

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

These are sometimes also referred to as "keys" in comments in GHC.

Instances

Eq Unique Source # |
Instance details Defined in Unique Methods (==) :: Unique -> Unique -> Bool # (/=) :: Unique -> Unique -> Bool #
Show Unique Source # |
Instance details Defined in Unique Methods showsPrec :: Int -> Unique -> ShowS Source # show :: Unique -> String Source # showList :: [Unique] -> ShowS Source #
Outputable Unique Source # |
Instance details Defined in Unique Methods ppr :: Unique -> SDoc Source # pprPrec :: Rational -> Unique -> SDoc Source #
Uniquable Unique Source # |
Instance details Defined in Unique Methods getUnique :: Unique -> Unique Source #

class Uniquable a where Source #

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

Minimal complete definition

getUnique

Methods

getUnique :: a -> Unique Source #

Instances

Uniquable Int Source # |
Instance details Defined in Unique Methods getUnique :: Int -> Unique Source #
Uniquable Name Source # |
Instance details Defined in Name Methods getUnique :: Name -> Unique Source #
Uniquable OccName Source # |
Instance details Defined in OccName Methods getUnique :: OccName -> Unique Source #
Uniquable TyCon Source # |
Instance details Defined in TyCon Methods getUnique :: TyCon -> Unique Source #
Uniquable FastString Source # |
Instance details Defined in Unique Methods getUnique :: FastString -> Unique Source #
Uniquable ComponentId Source # |
Instance details Defined in Module Methods getUnique :: ComponentId -> Unique Source #
Uniquable InstalledUnitId Source # |
Instance details Defined in Module Methods getUnique :: InstalledUnitId -> Unique Source #
Uniquable UnitId Source # |
Instance details Defined in Module Methods getUnique :: UnitId -> Unique Source #
Uniquable ModuleName Source # |
Instance details Defined in Module Methods getUnique :: ModuleName -> Unique Source #
Uniquable Module Source # |
Instance details Defined in Module Methods getUnique :: Module -> Unique Source #
Uniquable Unique Source # |
Instance details Defined in Unique Methods getUnique :: Unique -> Unique Source #
Uniquable RegClass Source # |
Instance details Defined in RegClass Methods getUnique :: RegClass -> Unique Source #
Uniquable Reg Source # | so we can put regs in UniqSets
Instance details Defined in RegAlloc.Graph.ArchBase Methods getUnique :: Reg -> Unique Source #
Uniquable Reg Source # |
Instance details Defined in Reg Methods getUnique :: Reg -> Unique Source #
Uniquable RealReg Source # |
Instance details Defined in Reg Methods getUnique :: RealReg -> Unique Source #
Uniquable VirtualReg Source # |
Instance details Defined in Reg Methods getUnique :: VirtualReg -> Unique Source #
Uniquable Label Source # |
Instance details Defined in Hoopl.Label Methods getUnique :: Label -> Unique Source #
Uniquable PackageName Source # |
Instance details Defined in PackageConfig Methods getUnique :: PackageName -> Unique Source #
Uniquable SourcePackageId Source # |
Instance details Defined in PackageConfig Methods getUnique :: SourcePackageId -> Unique Source #
Uniquable Var Source # |
Instance details Defined in Var Methods getUnique :: Var -> Unique Source #
Uniquable PatSyn Source # |
Instance details Defined in PatSyn Methods getUnique :: PatSyn -> Unique Source #
Uniquable DataCon Source # |
Instance details Defined in DataCon Methods getUnique :: DataCon -> Unique Source #
Uniquable ConLike Source # |
Instance details Defined in ConLike Methods getUnique :: ConLike -> Unique Source #
Uniquable CoAxiomRule Source # |
Instance details Defined in CoAxiom Methods getUnique :: CoAxiomRule -> Unique Source #
Uniquable Class Source # |
Instance details Defined in Class Methods getUnique :: Class -> Unique Source #
Uniquable LocalReg Source # |
Instance details Defined in CmmExpr Methods getUnique :: LocalReg -> Unique Source #
Uniquable EvBindsVar Source # |
Instance details Defined in TcEvidence Methods getUnique :: EvBindsVar -> Unique Source #
Uniquable name => Uniquable (AnnTarget name) Source # |
Instance details Defined in Annotations Methods getUnique :: AnnTarget name -> Unique Source #
Uniquable (CoAxiom br) Source # |
Instance details Defined in CoAxiom Methods getUnique :: CoAxiom br -> Unique Source #

uNIQUE_BITS :: Int Source #

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

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

pprUniqueAlways :: Unique -> SDoc Source #

mkUniqueGrimily :: Int -> Unique Source #

getKey :: Unique -> Int Source #

mkUnique :: Char -> Int -> Unique Source #

unpkUnique :: Unique -> (Char, Int) Source #

deriveUnique :: Unique -> Int -> Unique Source #

newTagUnique :: Unique -> Char -> Unique Source #

initTyVarUnique :: Unique Source #

initExitJoinUnique :: Unique Source #

nonDetCmpUnique :: Unique -> Unique -> Ordering Source #

isValidKnownKeyUnique :: Unique -> Bool Source #

The interface file symbol-table encoding assumes that known-key uniques fit in 30-bits; verify this.

See Note [Symbol table representation of names] in BinIface for details.

## Making built-in uniques

mkAlphaTyVarUnique :: Int -> Unique Source #

mkPrimOpIdUnique :: Int -> Unique Source #

mkPreludeMiscIdUnique :: Int -> Unique Source #

mkPreludeDataConUnique :: Arity -> Unique Source #

mkPreludeTyConUnique :: Int -> Unique Source #

mkPreludeClassUnique :: Int -> Unique Source #

mkPArrDataConUnique :: Int -> Unique Source #

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

mkPseudoUniqueD :: Int -> Unique Source #

mkPseudoUniqueE :: Int -> Unique Source #

mkPseudoUniqueH :: Int -> Unique Source #

## Deriving uniques

### From TyCon name uniques

tyConRepNameUnique :: Unique -> Unique Source #

### From DataCon name uniques

dataConWorkerUnique :: Unique -> Unique Source #

dataConRepNameUnique :: Unique -> Unique Source #