primitive icon indicating copy to clipboard operation
primitive copied to clipboard

Behavior of `Control.Monad.Primitive.touch` on boxed types

Open jberryman opened this issue 10 years ago • 2 comments

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.

jberryman avatar Dec 15 '14 21:12 jberryman

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

jberryman avatar Aug 20 '16 16:08 jberryman

Might be good to look at how its desugared / defined in ghc.

cartazio avatar Aug 21 '16 03:08 cartazio