<div dir="auto">You also need to avoid inspecting the StablePtr itself, which is just a number, to maintain purity. The whole thing is a bit weird. Why do you want this anyway?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 21, 2019, 7:39 AM David Feuer <<a href="mailto:david.feuer@gmail.com">david.feuer@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="auto">So something like<div dir="auto"><br></div><div dir="auto">newtype StablePtr a = StablePtr (StablePtrST RealWorld a)?</div><div dir="auto"><br></div><div dir="auto">I suppose that could work with some discipline. You have to assume that foreign code doesn't pick its address out of a hat and so something silly, but I guess you pretty much have to assume that anyway.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 21, 2019, 5:00 AM Matthew Farkas-Dyck <<a href="mailto:strake888@gmail.com" target="_blank" rel="noreferrer">strake888@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have been doing some work where i want `StablePtr`, but also to not<br>
be confined to `IO`. I saw the following comment in<br>
"compiler/prelude/PrimOp.hs":<br>
<br>
Question: Why @RealWorld@ - won't any instance of @_ST@ do the job? [ADR]<br>
<br>
It has been there for 20 years. What is the answer? If it is safe i'll<br>
send the patch generalizing these operations.<br>
_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org" rel="noreferrer noreferrer" target="_blank">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users" rel="noreferrer noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users</a><br>
</blockquote></div>
</blockquote></div>