Skip to content

cmpStablePtr# / hashing?

Currently, there are primops reallyUnsafePtrEquality# and eqStablePtr#, which allow us to compare two pointers for equality. I'm wondering whether we could also have comparison operations, or hashing operations, which would allow a user to collect MutVars or StablePtrs into a (Hash)Map.

I assume that we can't have reallyUnsafePtrComparison# because the GC provides no ordering guarantees. But what about StablePtrs? Could we have a comparison operation, or a hashing function?

Edited by sheaf
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information