Marcin 'Qrczak' Kowalczyk wrote:
> If the IO monad can maintain a random number generator, it can as
> well mainain unique Integer supply. The interface is clean.
It can, but according to the current specification, it doesn't.  Maybe
it should.  I think Integer is a little too specific - how about

type Unique implements (Ord,Eq)
newUnique :: IO Unique

?
> 
> And what about having unsafePtrCompare in addition to IOExts.unsafePtrEq?
I don't think unsafePtrCompare will get us out of jail here.  Compacting
garbage collection might change the order of the pointers around inbetween
one thread comparing them and the other.

Reply via email to