On Thu, May 3, 2018 at 2:40 PM Carter Schonwald <carter.schonwald@gmail.com> wrote:
I think Ed’s structs package explicitly makes use of this :)

Oh, interesting! Thanks for the pointer!

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#):
https://github.com/ekmett/structs/blob/master/src/Data/Struct/Internal.hs#L146

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 :)

Thanks!

- Michal