<p dir="ltr">Vector also does something like what your are describing. I think the phrase to google for is "array recycling".</p>
<br><div class="gmail_quote"><div dir="ltr">On 11:56PM, Fri, Jul 31, 2015 William Yager <<a href="mailto:will.yager@gmail.com">will.yager@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Has anyone done any research into fusing operations that involve thawing some data, mutating it, and then freezing it again?<div><br></div><div>Data.Vector does something similar; it turns vectors into streams, operates on the streams, and then turns them back into vectors. It can fuse these operations by removing intermediate  However, I've done a bit of preliminary work on a fusion system that works on operations of the form </div><div><br></div><div>    runST $ do </div><div>        x' <- thaw x</div><div>        foo x'</div><div>        freeze x'</div><div><br></div><div>and yields promising results in some cases. This could be useful for data structures that aren't stream-able, but suffer from lots of unnecessary freezing and unfreezing. </div><div><br></div><div>This seems like the sort of thing that someone would have already done, so I wanted to check if anyone knew of any previous work on this.</div><div><br></div><div>Cheers,</div><div>Will</div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div>