I have seen some push to take advantage of the new primop casMutVar, yet I see that atomicModifyMutVar hasn't been used yet either. For example, modifySTRef is just a read followed by a write. I've been unable to create a version that does not allocate with something as simple as modifySTRef ref (+1).
There is a package Data.Ref.Unboxed that allows ST to use an unboxed STURef, but even though I can see the Core using Int#, any use of modifySTURef, or any version I've been able to make will excessively box/rebox. Should I instead be using something like modifySTURef ref (GHC.Prim.+#) or can this be automatically done by the compiler?
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe