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

Modulebase-4.20.2.0Haskell2010

Data.Unique

An abstract interface to a unique symbol generator.

  • 1 type
  • 2 values
  • Packagebase-4.20.2.0
  • Exports3
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceUnique.hs

Unique objects

3 declarations
newtypenewtype Unique
#

An abstract unique object. Objects of type Unique may be compared for equality and ordering and hashed into Int.

Example1 expression
:{do x <- newUnique   print (x == x)   y <- newUnique   print (x == y):}TrueFalse
Instances2Eq, Ord
  • Eq UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Unique
  • Ord UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Unique
valuenewUnique :: IO Unique
#

Creates a new object of type Unique. The value returned will not compare equal to any other value of type Unique returned by previous calls to newUnique. There is no limit on the number of times newUnique may be called.