yesodweb/wai — comment on commit bcfa01bb3ca3710f9e0115a3bc95c1ae8886c374
File: conduit/Control/Monad/Trans/Resource.hs line 49
By meteficha:

Is this better than a counter inside an IORef using atomicModifyIORef? At least with a counter we guarantee at least 2^30 resources (the report mandates only 31 bits) before one bumping on the other. The hash, on the other hand, has a low probability of colliding but the probability is at least 1/2^30, so in the best case it is as good as a counter.