<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Feb 24, 2011, at 3:45 PM, Andrew Coppin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>OK, so I had a function that looks like<br><br> &nbsp;transform :: [Word8] -&gt; [Word16]<br><br>It works nicely, but I'd like to use mutable state inside. No problem! Use the ST monad. Something like<br><br> &nbsp;transform :: [Word8] -&gt; [Word16]<br> &nbsp;transform xs = runST (work xs)<br> &nbsp;&nbsp;&nbsp;where<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;work :: [Word8] -&gt; ST s [Word16]<br><br>Ah, yes, well there is one *small* problem... If you do that, the function becomes too strict.<br></div></blockquote></div><br><div>unsafeInterleaveST?</div><div><br></div><div><a href="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad-ST.html#v:unsafeInterleaveST">http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad-ST.html#v:unsafeInterleaveST</a></div><div><br></div><div>--Sterl</div></body></html>