primitive
primitive copied to clipboard
Behavior of `Control.Monad.Primitive.touch` on boxed types
This is a request for documentation. I'm having trouble finding details about how touch# behaves, primarily I'd like to know if it works if I call it on say an IORef when GHC has unboxed that IORef (similar to the issue with Weak references). If it does have the same problem (and touch# should only be passed primitive types), then it would seem wise to deprecate touch.
I notice the touch here call touch# on a boxed type, for whatever that's worth. http://hackage.haskell.org/package/base-4.9.0.0/docs/src/GHC.ForeignPtr.html#touch
Might be good to look at how its desugared / defined in ghc.