HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-9.10.3GHC2021

GHC.Types.Unique

  • 1 type
  • 1 class
  • 20 values
  • Packageghc-9.10.3
  • Exports22
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceUnique.hs

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, Outputable, Uniquable
classclass Uniquable a where
#

Class of things that we can obtain a Unique from

Methods

Instances36Uniquable, …

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.

Local uniques

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