Skip to content

Add unsafeThawByteArray#

It looks like this operation doesn't exist. primitive implementation is horryfying: https://hackage.haskell.org/package/primitive-0.7.4.0/docs/src/Data.Primitive.ByteArray.html#unsafeThawByteArray

-- | Convert an immutable byte array to a mutable one without copying. The
-- original array should not be used after the conversion.
unsafeThawByteArray
  :: PrimMonad m => ByteArray -> m (MutableByteArray (PrimState m))
{-# INLINE unsafeThawByteArray #-}
unsafeThawByteArray (ByteArray arr#)
  = primitive (\s# -> (# s#, MutableByteArray (unsafeCoerce# arr#) #))

And it's used on Hackage: https://hackage-search.serokell.io/?q=unsafeThawByteArray

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information