nom-0.1.0.2: Name-binding & alpha-equivalence

Safe HaskellTrustworthy
LanguageHaskell2010

Language.Nominal.Unique

Synopsis

Documentation

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
Eq Unique Source # 
Instance details

Defined in Language.Nominal.Unique

Methods

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

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

Data Unique Source # 
Instance details

Defined in Language.Nominal.Unique

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Unique -> c Unique #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Unique #

toConstr :: Unique -> Constr #

dataTypeOf :: Unique -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Unique) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Unique) #

gmapT :: (forall b. Data b => b -> b) -> Unique -> Unique #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Unique -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Unique -> r #

gmapQ :: (forall d. Data d => d -> u) -> Unique -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Unique -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Unique -> m Unique #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Unique -> m Unique #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Unique -> m Unique #

Ord Unique Source # 
Instance details

Defined in Language.Nominal.Unique

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 Uniques may hash to the same value, although in practice this is unlikely. The Int returned makes a good hash key.