
6 Apr
2021
6 Apr
'21
8 a.m.
On Tue, 6 Apr 2021, YueCompl via Haskell-Cafe wrote:
In an attempt to determine whether two immutable vectors can be treated as the same one to enable specific optimizations for that case, I tried to use ST to determine their respective backing foreign ptrs for comparison. But appears it can be copied when wrapped in a newtype, I wonder why it is the case, and how to avoid the copy?
You compare the ForeignPtrs of the mutable vectors. What about comparing the ForeignPtrs of the original immutable vectors?