<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, May 3, 2018 at 2:40 PM Carter Schonwald <<a href="mailto:carter.schonwald@gmail.com">carter.schonwald@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><div dir="auto">I think Ed’s structs package explicitly makes use of this :)</div></div></blockquote><div><br></div><div>Oh, interesting! Thanks for the pointer!</div><div><br></div><div>Looking at Ed's code, he's seems to be doing something similar to that I'm also interested in: having a SmallArray# that at one index points to another SmallArray# and at another one to a ByteArray#.  (my use case involves multiple small arrays, so I'd rather use SmallArray# than ArrayArray#):</div><div><a href="https://github.com/ekmett/structs/blob/master/src/Data/Struct/Internal.hs#L146">https://github.com/ekmett/structs/blob/master/src/Data/Struct/Internal.hs#L146</a><br></div><div><br></div><div>So I guess my second question becomes: is anyone aware of some rts/GC invariants/expectations that would be broken by doing this? (ignoring the issue of getting every `unsafeCoerce#` right :)</div><div><br></div><div>Thanks!</div><div><br></div><div>- Michal</div></div></div>