ghc-8.2.0.20170704: The GHC API

Safe HaskellNone
LanguageHaskell2010

Unique

Contents

Synopsis

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.

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 # 

Methods

getUnique :: Int -> Unique Source #

Uniquable Name # 
Uniquable OccName # 
Uniquable TyCon # 
Uniquable FastString # 
Uniquable ComponentId # 
Uniquable InstalledUnitId # 
Uniquable UnitId # 
Uniquable ModuleName # 
Uniquable Module # 
Uniquable Unique # 
Uniquable RegClass # 
Uniquable Reg #

so we can put regs in UniqSets

Methods

getUnique :: Reg -> Unique Source #

Uniquable Reg # 

Methods

getUnique :: Reg -> Unique Source #

Uniquable RealReg # 
Uniquable VirtualReg # 
Uniquable PackageName # 
Uniquable SourcePackageId # 
Uniquable Var # 

Methods

getUnique :: Var -> Unique Source #

Uniquable PatSyn # 
Uniquable DataCon # 
Uniquable ConLike # 
Uniquable CoAxiomRule # 
Uniquable Class # 
Uniquable LocalReg # 
Uniquable EvBindsVar # 
Uniquable name => Uniquable (AnnTarget name) # 

Methods

getUnique :: AnnTarget name -> Unique Source #

Uniquable (CoAxiom br) # 

Methods

getUnique :: CoAxiom br -> Unique Source #

Constructors, destructors and operations on Uniques

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

Deriving uniques

From TyCon name uniques

From DataCon name uniques