<div><div dir="auto">I think Ed’s structs package explicitly makes use of this :)</div><br><div class="gmail_quote"><div>On Wed, May 2, 2018 at 7:31 AM Michal Terepeta <<a href="mailto:michal.terepeta@gmail.com">michal.terepeta@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I have a quick question about ArrayArray#. Is it safe to store *both* an<br>
ByteArray# and ArrayArray# within the *same* ArrayArray#? For instance:<br>
- at index 0 of an ArrayArray# I store a different ArrayArray#,<br>
- at index 1 of that same ArrayArray# I store a ByteArray#.<br>
<br>
It seems to me that this should be safe/supported from the point of view of<br>
the runtime system:<br>
- both ArrayArray# and ByteArray# have the same kind/runtime representation,<br>
- the arrays have a header that tells rts/GC what they are/how to handle<br>
them.<br>
(But I, as a user, would be responsible for using the right primop with the<br>
right index to read them back)<br>
<br>
Is this correct?<br>
<br>
Thanks a lot!<br>
<br>
- Michal<br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div></div>