Copyright | (c) The University of Glasgow 2001 |
---|---|
License | BSD-style (see the file libraries/base/LICENSE) |
Maintainer | [email protected] |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
An abstract interface to a unique symbol generator.
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
Eq Unique | |
Ord Unique | |
Defined in Data.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.
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.
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/8.6.1/docs/html/libraries/base-4.12.0.0/Data-Unique.html