<div dir="ltr">the point of touch is to prevent premature GC, it actually gets erased at the CMM level i believe. <div>That is, it only makes sense to apply touch to lifted types on the heap! </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 15, 2014 at 4:21 PM, Brandon Simmons <span dir="ltr"><<a href="mailto:brandon.m.simmons@gmail.com" target="_blank">brandon.m.simmons@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The `primitive` package exports a lifted version of the undocumented `touch#`<br>
<br>
    <a href="http://hackage.haskell.org/package/ghc-prim-0.3.1.0/docs/GHC-Prim.html" target="_blank">http://hackage.haskell.org/package/ghc-prim-0.3.1.0/docs/GHC-Prim.html</a><br>
<br>
which has type:<br>
<br>
    touch :: PrimMonad m => a -> m ()<br>
<br>
I'd like to know if this works correctly in general, or will it suffer<br>
from the same gotches w/r/t unboxing as with addFinalizer and Weak<br>
references? i.e. must it only be passed an unboxed type?<br>
<br>
Brandon<br>
_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
</blockquote></div></div>