<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 19 Sep 2018, at 1:07 am, Daniel Cartwright <<a href="mailto:chessai1996@gmail.com" class="">chessai1996@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">in GHC.Prim, there is a primitive 'touch#'. It seems that it is used to keep pointers alive, and takes something of any runtime representation, and a State# RealWorld, but there's really no documentation on it, so my idea of what it does is just a guess. Can anyone explain what exactly it does?</div></div></blockquote><br class=""></div><div>It’s used to place a dependency on a computed value, to prevent the GHC simplifier from moving the binding that computes it around. This is sometimes helpful when writing array fusion systems.</div><div class=""><br class=""></div><div class="">I mentioned it briefly in </div><div class=""><a href="http://benl.ouroborus.net/papers/2011-stencil/stencil-haskell2011.pdf" class="">http://benl.ouroborus.net/papers/2011-stencil/stencil-haskell2011.pdf</a></div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Ben.</div><div class=""><br class=""></div></body></html>