HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduleghc-lib-parser-9.14.1.20251220GHC2021

GHC.Types.Unique

  • 1 type
  • 1 class
  • 20 values

Main data types

3 declarations
newtypenewtype Unique
#

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.

Instances4Eq, Show, Uniquable, Outputable
  • Eq UniqueDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.Unique
  • Show UniqueDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.Unique
  • Uniquable UniqueDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.Unique
  • Outputable UniqueDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.Unique
classclass Uniquable a where
#

Class of things that we can obtain a Unique from

Methods

Instances33Uniquable, …

Constructors, destructors and operations on Uniques

valuemkTag :: Char -> Word64
#

Put the character in the highest bits of the Word64. This may truncate the character to 8. This function is used in mkSplitUniqSupply so that it can precompute and share the tag part of the uniques it generates.

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 GHC.Iface.Binary for details.

Local uniques

These are exposed exclusively for use by uniqAway, which has rather peculiar needs. See Note [Local uniques].