base-4.21.0.0: Core data structures and operations
Copyright(c) The University of Glasgow 2001
LicenseBSD-style (see the file libraries/base/LICENSE)
Maintainerlibraries@haskell.org
Stabilitystable
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

Data.Unique

Description

An abstract interface to a unique symbol generator.

Synopsis

Unique objects

data Unique Source #

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

>>> :{
do x <- newUnique
 print (x == x)
 y <- newUnique
 print (x == y)
:}
True
False

Instances

Instances details
Instance details

Defined in GHC.Internal.Data.Unique

Methods

(==) :: Unique -> Unique -> Bool Source #

(/=) :: Unique -> Unique -> Bool Source #

newUnique :: IO Unique Source #

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.

hashUnique :: Unique -> Int Source #

Hashes a Unique into an Int . Two Unique s may hash to the same value, although in practice this is unlikely. The Int returned makes a good hash key.

AltStyle によって変換されたページ (->オリジナル) /