
1 Sep
2007
1 Sep
'07
7:03 a.m.
Hi, I was looking over the libraries for bits of GHC (no doubt a standard form of relaxation for readers of this list), and noticed the following statement (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'. This set me thinking - so I looked at the code newUnique :: IO Unique newUnique = do val <- takeMVar uniqSource let next = val+1 putMVar uniqSource next return (Unique next) In the concurrent execution world in which we live - I don't think that the implementation supports the "uniqueness" statement above - or am I not understanding something? Cheers Neil