
I've noticed that there is no longer an "unsafeThawByteArray#" function in GHC.Prim. Looking through the darcs history, I found a patch with description: [project @ 2000-03-13 12:11:43 by simonmar] simonmar**20000313121144 Remove unsafeThawByteArray# primop (which was a no-op), and use unsafeCoerce# instead. ] Is the following code safe? data IntArray = IntArray !Int (ByteArray#) data STIntArray s = STIntArray !Int (MutableByteArray# s) unsafeThaw :: IntArray -> ST s (STIntArray s) unsafeThaw (IntArray n arr#) = ST $ \s1# -> let coerceArray :: State# s -> MutableByteArray# s coerceArray _ = unsafeCoerce# arr# marr# = coerceArray s1# marr = STIntArray n marr# in (# s1#, marr #) Thanks, Patrick